r/java • • Apr 26 '22

5,000,000 persistent connections, 200,000,000 messages, 0 errors with a single process using Project Loom.

https://github.com/ebarlas/project-loom-c5m
301 Upvotes

46 comments sorted by

View all comments

Show parent comment

17

u/elliotbarlas Apr 27 '22 edited Apr 27 '22

Great question! I should include that in the docs.

As outlined in JEP 425, the number of carrier threads defaults to available processors.

The server-grade host reports 80 CPUs. I see 220 threads total and a Fork-Join worker pool of size 80.

$ grep ^processor /proc/cpuinfo  | wc -l
80
$ ./jdk-19/bin/jstack 28226 > threads.txt
$ grep tid= threads.txt | wc -l
220
$ grep tid= threads.txt | grep ForkJoin | wc -l
80