public abstract class JettyServerHelper extends HttpServerHelper
Parameter name | Value type | Default value | Description |
---|---|---|---|
threadPool.minThreads | int | 8 | Thread pool minimum threads |
threadPool.maxThreads | int | 200 | Thread pool max threads |
threadPool.threadsPriority | int | Thread.NORM_PRIORITY |
Thread pool threads priority |
threadPool.idleTimeout | int | 60000 | Thread pool idle timeout in milliseconds; threads that are idle for longer than this period may be stopped |
threadPool.stopTimeout | long | 5000 | Thread pool stop timeout in milliseconds; the maximum time allowed for the service to shutdown |
connector.acceptors | int | -1 | Connector acceptor thread count; when -1, Jetty will default to Runtime.availableProcessors() / 2, with a
minimum of 1 |
connector.selectors | int | -1 | Connector selector thread count; when -1, Jetty will default to Runtime.availableProcessors() |
connector.acceptQueueSize | int | 0 | Connector accept queue size; also known as accept backlog |
connector.idleTimeout | int | 30000 | Connector idle timeout in milliseconds; see Socket.setSoTimeout(int) ; this value is interpreted as the
maximum time between some progress being made on the connection; so if a single byte is read or written, then the
timeout is reset |
connector.soLingerTime | int | -1 | Connector TCP/IP SO linger time in milliseconds; when -1 is disabled; see
Socket.setSoLinger(boolean, int) |
connector.stopTimeout | long | 30000 | Connector stop timeout in milliseconds; the maximum time allowed for the service to shutdown |
http.headerCacheSize | int | 512 | HTTP header cache size in bytes |
http.requestHeaderSize | int | 8*1024 | HTTP request header size in bytes; larger headers will allow for more and/or larger cookies plus larger form content encoded in a URL; however, larger headers consume more memory and can make a server more vulnerable to denial of service attacks |
http.responseHeaderSize | int | 8*1024 | HTTP response header size in bytes; larger headers will allow for more and/or larger cookies and longer HTTP headers (e.g. for redirection); however, larger headers will also consume more memory |
http.outputBufferSize | int | 32*1024 | HTTP output buffer size in bytes; a larger buffer can improve performance by allowing a content producer to run without blocking, however larger buffers consume more memory and may induce some latency before a client starts processing the content |
lowResource.period | int | 1000 | Low resource monitor period in milliseconds; when 0, low resource monitoring is disabled |
lowResource.threads | boolean | true | Low resource monitor, whether to check if we're low on threads |
lowResource.maxMemory | int | 0 | Low resource monitor max memory in bytes; when 0, the check disabled; memory used is calculated as (totalMemory-freeMemory) |
lowResource.maxConnections | int | 0 | Low resource monitor max connections; when 0, the check is disabled |
lowResource.idleTimeout | int | 1000 | Low resource monitor idle timeout in milliseconds; applied to EndPoints when in the low resources state |
lowResource.stopTimeout | long | 30000 | Low resource monitor stop timeout in milliseconds; the maximum time allowed for the service to shutdown |
Constructor and Description |
---|
JettyServerHelper(Server server)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected abstract org.eclipse.jetty.server.ConnectionFactory[] |
createConnectionFactories(org.eclipse.jetty.server.HttpConfiguration configuration)
Creates new internal Jetty connection factories.
|
int |
getConnectorAcceptors()
Connector acceptor thread count.
|
int |
getConnectorAcceptQueueSize()
Connector accept queue size.
|
org.eclipse.jetty.io.ByteBufferPool |
getConnectorByteBufferPool()
Connector byte buffer pool.
|
java.util.concurrent.Executor |
getConnectorExecutor()
Connector executor.
|
int |
getConnectorIdleTimeout()
Connector idle timeout in milliseconds.
|
org.eclipse.jetty.util.thread.Scheduler |
getConnectorScheduler()
Connector scheduler.
|
int |
getConnectorSelectors()
Connector selector thread count.
|
int |
getConnectorSoLingerTime()
Connector TCP/IP SO linger time in milliseconds.
|
int |
getConnectorStopTimeout()
Connector stop timeout in milliseconds.
|
int |
getHttpHeaderCacheSize()
HTTP header cache size in bytes.
|
int |
getHttpOutputBufferSize()
HTTP output buffer size in bytes.
|
int |
getHttpRequestHeaderSize()
HTTP request header size in bytes.
|
int |
getHttpResponseHeaderSize()
HTTP response header size in bytes.
|
int |
getLowResourceMonitorIdleTimeout()
Low resource monitor idle timeout in milliseconds.
|
int |
getLowResourceMonitorMaxConnections()
Low resource monitor max connections.
|
long |
getLowResourceMonitorMaxMemory()
Low resource monitor max memory in bytes.
|
int |
getLowResourceMonitorPeriod()
Low resource monitor period in milliseconds.
|
long |
getLowResourceMonitorStopTimeout()
Low resource monitor stop timeout in milliseconds.
|
boolean |
getLowResourceMonitorThreads()
Low resource monitor, whether to check if we're low on threads.
|
int |
getThreadPoolIdleTimeout()
Thread pool idle timeout in milliseconds.
|
int |
getThreadPoolMaxThreads()
Thread pool maximum threads.
|
int |
getThreadPoolMinThreads()
Thread pool minimum threads.
|
long |
getThreadPoolStopTimeout()
Thread pool stop timeout in milliseconds.
|
int |
getThreadPoolThreadsPriority()
Thread pool threads priority.
|
protected org.eclipse.jetty.server.Server |
getWrappedServer()
Returns the wrapped Jetty server.
|
protected void |
setWrappedServer(org.eclipse.jetty.server.Server wrappedServer)
Sets the wrapped Jetty server.
|
void |
start() |
void |
stop() |
getAdapter, handle, setAdapter
handle, setEphemeralPort, setEphemeralPort
getConnectorService, getContext, getProtocols, update
getAttributes, getHelped, getHelpedParameters, getLogger, getMetadataService, setHelped
public JettyServerHelper(Server server)
server
- The server to help.protected abstract org.eclipse.jetty.server.ConnectionFactory[] createConnectionFactories(org.eclipse.jetty.server.HttpConfiguration configuration)
configuration
- The HTTP configuration.public int getConnectorAcceptors()
Runtime.availableProcessors()
/ 2, with a minimum of
1.public int getConnectorAcceptQueueSize()
Also known as accept backlog.
public org.eclipse.jetty.io.ByteBufferPool getConnectorByteBufferPool()
ArrayByteBufferPool
.public java.util.concurrent.Executor getConnectorExecutor()
public int getConnectorIdleTimeout()
See Socket.setSoTimeout(int)
.
This value is interpreted as the maximum time between some progress being made on the connection. So if a single byte is read or written, then the timeout is reset.
public org.eclipse.jetty.util.thread.Scheduler getConnectorScheduler()
ScheduledExecutorScheduler
.public int getConnectorSelectors()
Runtime.availableProcessors()
.public int getConnectorSoLingerTime()
See Socket.setSoLinger(boolean, int)
.
public int getConnectorStopTimeout()
The maximum time allowed for the service to shutdown.
public int getHttpHeaderCacheSize()
public int getHttpOutputBufferSize()
A larger buffer can improve performance by allowing a content producer to run without blocking, however larger buffers consume more memory and may induce some latency before a client starts processing the content.
public int getHttpRequestHeaderSize()
Larger headers will allow for more and/or larger cookies plus larger form content encoded in a URL. However, larger headers consume more memory and can make a server more vulnerable to denial of service attacks.
public int getHttpResponseHeaderSize()
Larger headers will allow for more and/or larger cookies and longer HTTP headers (e.g. for redirection). However, larger headers will also consume more memory.
public int getLowResourceMonitorIdleTimeout()
Applied to EndPoints when in the low resources state.
public int getLowResourceMonitorMaxConnections()
public long getLowResourceMonitorMaxMemory()
Memory used is calculated as (totalMemory-freeMemory).
public int getLowResourceMonitorPeriod()
public long getLowResourceMonitorStopTimeout()
The maximum time allowed for the service to shutdown.
public boolean getLowResourceMonitorThreads()
public int getThreadPoolIdleTimeout()
Threads that are idle for longer than this period may be stopped.
public int getThreadPoolMaxThreads()
public int getThreadPoolMinThreads()
public long getThreadPoolStopTimeout()
The maximum time allowed for the service to shutdown.
public int getThreadPoolThreadsPriority()
Thread.NORM_PRIORITY
.protected org.eclipse.jetty.server.Server getWrappedServer()
protected void setWrappedServer(org.eclipse.jetty.server.Server wrappedServer)
wrappedServer
- The wrapped Jetty server.public void start() throws java.lang.Exception
start
in class ConnectorHelper<Server>
java.lang.Exception
public void stop() throws java.lang.Exception
stop
in class ServerHelper
java.lang.Exception
Copyright © 2005-2020 Restlet.