Friday 30 December 2022

Jetty server | default acceptors and selectors

 

If acceptor and selector threads are not defined in the config file, Jetty will calculate them using the following logic.

Acceptor thread calculation in Jetty


acceptors=Math.max(1, Math.min(4,cores/8))


Selector thread calculation in Jetty


int threads = ((ThreadPool.SizedThreadPool)executor).getMaxThreads();

int cpus = Runtime.getRuntime().availableProcessors();

selectors=Math.max(1,Math.min(cpus/2,threads/16));


Read more: https://support.sonatype.com/hc/en-us/articles/360000744687-Understanding-Eclipse-Jetty-9-4-Thread-Allocation

Related Posts Plugin for WordPress, Blogger...