public int getPollTime() { return ((AprEndpoint)endpoint).getPollTime(); }
public void setPollTime(int pollTime) { ((AprEndpoint)endpoint).setPollTime(pollTime); }
- public void setPollerSize(int pollerSize) { ((AprEndpoint)endpoint).setPollerSize(pollerSize); }
- public int getPollerSize() { return ((AprEndpoint)endpoint).getPollerSize(); }
+ // pollerSize is now a synonym for maxConnections
+ public void setPollerSize(int pollerSize) { endpoint.setMaxConnections(pollerSize); }
+ public int getPollerSize() { return endpoint.getMaxConnections(); }
// ----------------------------------------------------- JMX related methods
public int getPollTime() { return ((AprEndpoint)endpoint).getPollTime(); }
public void setPollTime(int pollTime) { ((AprEndpoint)endpoint).setPollTime(pollTime); }
- public void setPollerSize(int pollerSize) { ((AprEndpoint)endpoint).setPollerSize(pollerSize); }
- public int getPollerSize() { return ((AprEndpoint)endpoint).getPollerSize(); }
+ public void setPollerSize(int pollerSize) { endpoint.setMaxConnections(pollerSize); }
+ public int getPollerSize() { return endpoint.getMaxConnections(); }
public void setPollerThreadCount(int pollerThreadCount) { ((AprEndpoint)endpoint).setPollerThreadCount(pollerThreadCount); }
public int getPollerThreadCount() { return ((AprEndpoint)endpoint).getPollerThreadCount(); }
protected ConcurrentLinkedQueue<SocketWrapper<Long>> waitingRequests =
new ConcurrentLinkedQueue<SocketWrapper<Long>>();
+ // ------------------------------------------------------------ Constructor
+
+ public AprEndpoint() {
+ // Need to override the default for maxConnections to align it with what
+ // was pollerSize (before the two were merged)
+ setMaxConnections(8 * 1024);
+ }
+
// ------------------------------------------------------------- Properties
/**
- * Size of the socket poller.
- */
- protected int pollerSize = 8 * 1024;
- public void setPollerSize(int pollerSize) { this.pollerSize = pollerSize; }
- public int getPollerSize() { return pollerSize; }
-
-
- /**
* Size of the sendfile (= concurrent files which can be served).
*/
protected int sendfileSize = 1 * 1024;
acceptorThreadCount = 1;
}
if (pollerThreadCount == 0) {
- if ((OS.IS_WIN32 || OS.IS_WIN64) && (pollerSize > 1024)) {
+ if ((OS.IS_WIN32 || OS.IS_WIN64) && (getMaxConnections() > 1024)) {
// The maximum per poller to get reasonable performance is 1024
- pollerThreadCount = pollerSize / 1024;
+ pollerThreadCount = getMaxConnections() / 1024;
// Adjust poller size so that it won't reach the limit
- pollerSize = pollerSize - (pollerSize % 1024);
+ setMaxConnections(
+ getMaxConnections() - (getMaxConnections() % 1024));
} else {
// No explicit poller size limitation
pollerThreadCount = 1;
*/
protected void init() {
pool = Pool.create(serverSockPool);
- int size = pollerSize / pollerThreadCount;
+ int size = getMaxConnections() / pollerThreadCount;
int timeout = getKeepAliveTimeout();
if (timeout <= 0) {
timeout = socketProperties.getSoTimeout();
connector once 75% of the processing threads are in use and make the
threshold configurable. (markt)
</fix>
+ <fix>
+ Make pollerSize and maxConnections synonyms for the APR connectors since
+ they perform the same function. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
<strong>connectionTimeout</strong> attribute.</p>
</attribute>
+ <attribute name="maxConnections" required="false">
+ <p>The maximum number of connections that the server will accept and
+ process at any given time. When this number has been reached, the server
+ will not accept any more connections until the number of connections
+ falls below this value. The operating system may still accept
+ connections based on the <code>acceptCount</code> setting. Default value
+ varies by connector type. For BIO and NIO the default is
+ <code>10000</code>. For APR/native, the default is <code>8192</code>.</p>
+ <p>Note that for APR/native on Windows, the configured value will be
+ reduced to the highest multiple of 1024 that is less than or equal to
+ maxConnections. This is done for performance reasons.</p>
+ </attribute>
+
<attribute name="maxHttpHeaderSize" required="false">
<p>The maximum size of the request and response HTTP header, specified
in bytes. If not specified, this attribute is set to 8192 (8 KB).</p>
the default value is <code>75</code>.</p>
</attribute>
- <attribute name="maxConnections" required="false">
- <p>The maximum number of connections that the server will accept and
- process at any given time. When this number has been reached, the server
- will not accept any more connections until the number of connections
- falls below this value. The operating system may still accept
- connections based on the <code>acceptCount</code> setting. Default value
- is <code>10000</code>.</p>
- </attribute>
-
</attributes>
</subsection>
<p>Amount of sockets that the poller responsible for polling kept alive
connections can hold at a given time. Extra connections will be closed
right away. The default value is 8192, corresponding to 8192 keep-alive
- connections.</p>
+ connections. This is a synonym for maxConnections.</p>
</attribute>
<attribute name="pollerThreadCount" required="false">