Author: fhanik Date: Wed May 2 21:36:44 2012 New Revision: 1333221 URL: http://svn.apache.org/viewvc?rev=1333221&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/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml tomcat/tc7.0.x/trunk/webapps/docs/config/http.xml Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=1333221&r1=1333220&r2=1333221&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Wed May 2 21:36:44 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/tc7.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1333221&r1=1333220&r2=1333221&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Wed May 2 21:36:44 2012 @@ -88,6 +88,11 @@ <bug>53173</bug> (<rev>1333116</rev>) : Properly count down maxConnections (fhanik) </fix> + <update> + Update default value of pollerThreadCount for the NIO connector. + The new default value will never go above 2 regardless of + available processors. (fhanik) + </update> </changelog> </subsection> <subsection name="Cluster"> Modified: tomcat/tc7.0.x/trunk/webapps/docs/config/http.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/config/http.xml?rev=1333221&r1=1333220&r2=1333221&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/webapps/docs/config/http.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/config/http.xml Wed May 2 21:36:44 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: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org