lhotari commented on pull request #14320:
URL: https://github.com/apache/pulsar/pull/14320#issuecomment-1041581863


   > > These are threads. Jetty defaults to 200 maximum threads
   > 
   > @lhotari Do we need to take the number of availableProcessors into 
consideration for the maximum threads of the thread pool?
   
   No. Jetty is different from Netty in this aspect. In Netty, everything 
should be asynchronous and "thou shall never block". In Jetty, the maximum 
number of threads for the thread pool should be set to 50-500 threads and 
blocking operations are fine. 
   
   The recommendation for the thread pool is explained in Jetty documentation 
https://www.eclipse.org/jetty/documentation/jetty-9/index.html#_thread_pool
   > Thread Pool
   > Configure with goal of limiting memory usage maximum available. Typically 
this is >50 and <500
   
   In Jetty there's also a "acceptor" and "selector" thread count settings. 
These have been fixed to 1 in Pulsar.
   > Acceptors
   > The standard rule of thumb for the number of Accepters to configure is one 
per CPU on a given machine.
   
   @Shoothzj  The number of acceptors should take the system cpu cores into 
account. However that is a different setting and Pulsar now uses a fixed number 
there: 1. 
   
   http port:
   
https://github.com/apache/pulsar/blob/b540523b474e4194e30c1acab65dfafdd11d3210/pulsar-broker/src/main/java/org/apache/pulsar/broker/web/WebService.java#L88
   
   https port:
   
https://github.com/apache/pulsar/blob/b540523b474e4194e30c1acab65dfafdd11d3210/pulsar-broker/src/main/java/org/apache/pulsar/broker/web/WebService.java#L125
   
   acceptors and selectors should be both set to -1. Jetty would pick the 
recommended count based on cores in that case. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to