protected JIoEndpoint endpoint;
+ /**
+ * The percentage of threads that have to be in use before keep-alive is
+ * disabled to aid scalability.
+ */
+ private int disableKeepAlivePercentage = 75;
+
// --------------------------------------------------------- Public Methods
}
+ public int getDisableKeepAlivePercentage() {
+ return disableKeepAlivePercentage;
+ }
+
+
+ public void setDisableKeepAlivePercentage(int disableKeepAlivePercentage) {
+ this.disableKeepAlivePercentage = disableKeepAlivePercentage;
+ }
+
+
/**
* Process pipelined HTTP requests on the specified socket.
*
/ endpoint.getMaxThreads();
}
// Disable keep-alive if we are running low on threads
- if (threadRatio > 75) {
- keepAliveLeft = 1;
+ if (threadRatio > getDisableKeepAlivePercentage()) {
+ keepAliveLeft = 1;
}
try {
protected Http11ConnectionHandler cHandler;
+ // ------------------------------------------------ HTTP specific properties
+ // ------------------------------------------ managed in the ProtocolHandler
+
+ private int disableKeepAlivePercentage = 75;
+ public int getDisableKeepAlivePercentage() {
+ return disableKeepAlivePercentage;
+ }
+ public void setDisableKeepAlivePercentage(int disableKeepAlivePercentage) {
+ if (disableKeepAlivePercentage < 0) {
+ this.disableKeepAlivePercentage = 0;
+ } else if (disableKeepAlivePercentage > 100) {
+ this.disableKeepAlivePercentage = 100;
+ } else {
+ this.disableKeepAlivePercentage = disableKeepAlivePercentage;
+ }
+ }
+
// ----------------------------------------------------- JMX related methods
@Override
processor.setSocketBuffer(proto.getSocketBuffer());
processor.setMaxSavePostSize(proto.getMaxSavePostSize());
processor.setServer(proto.getServer());
+ processor.setDisableKeepAlivePercentage(
+ proto.getDisableKeepAlivePercentage());
register(processor);
return processor;
}
Improve handling in AJP connectors of the case where too large a AJP
packet is received. (markt)
</fix>
+ <fix>
+ Restore the automatic disabling of HTTP keep-alive with the BIO
+ connector once 75% of the processing threads are in use and make the
+ threshold configurable. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
<attributes>
+ <attribute name="disableKeepAlivePercentage" required="false">
+ <p>The percentage of processing threads that have to be in use before
+ HTTP keep-alives are disabled to improve scalability. Values less than
+ <code>0</code> will be changed to <code>0</code> and values greater than
+ <code>100</code> will be changed to <code>100</code>. If not specified,
+ 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