Author: fhanik
Date: Wed May 2 21:33:43 2012
New Revision: 1333218
URL: http://svn.apache.org/viewvc?rev=1333218&view=rev
Log:
Modify the default pollerThreadCount
as processors go, it gets very polluting and resource wasting to have 24,48 or
64 and more poller threads
Very hard for applications to see a performance benefit of more than 2 pollers
Modified:
tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
tomcat/trunk/webapps/docs/changelog.xml
tomcat/trunk/webapps/docs/config/http.xml
Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=1333218&r1=1333217&r2=1333218&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Wed May 2
21:33:43 2012
@@ -333,7 +333,7 @@ public class NioEndpoint extends Abstrac
/**
* Poller thread count.
*/
- protected int pollerThreadCount =
Runtime.getRuntime().availableProcessors();
+ protected int pollerThreadCount =
Math.min(2,Runtime.getRuntime().availableProcessors());
public void setPollerThreadCount(int pollerThreadCount) {
this.pollerThreadCount = pollerThreadCount; }
public int getPollerThreadCount() { return pollerThreadCount; }
Modified: tomcat/trunk/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1333218&r1=1333217&r2=1333218&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Wed May 2 21:33:43 2012
@@ -72,6 +72,15 @@
</fix>
</changelog>
</subsection>
+ <subsection name="Coyote">
+ <changelog>
+ <scode>
+ Update default value of pollerThreadCount for the NIO connector.
+ The new default value will never go above 2 regardless of
+ available processors. (fhanik)
+ </scode>
+ </changelog>
+ </subsection>
<subsection name="Tribes">
<changelog>
<scode>
Modified: tomcat/trunk/webapps/docs/config/http.xml
URL:
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/http.xml?rev=1333218&r1=1333217&r2=1333218&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/http.xml (original)
+++ tomcat/trunk/webapps/docs/config/http.xml Wed May 2 21:33:43 2012
@@ -608,8 +608,15 @@
<attribute name="pollerThreadCount" required="false">
<p>(int)The number of threads to be used to run for the polling events.
- Default value is <code>1</code> per processor. Can't see a reason to go
- above that. But experiment and find your own results.</p>
+ Default value is <code>1</code> per processor up to and including
version 7.0.27.
+ Default value as of version 7.0.28 is <code>1</code> per processor but
not more than 2.<br/>
+ When accepting a socket, the operating system holds a global lock. So
the benefit of
+ going above 2 threads diminishes rapidly. Having more than one thread
is for
+ system that need to accept connections very rapidly. However usually
just
+ increasing <code>acceptCount</code> will solve that problem.
+ Increasing this value may also be beneficial when a large amount of
send file
+ operations are going on.
+ </p>
</attribute>
<attribute name="pollerThreadPriority" required="false">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]