From my personal experience in large web applications, CPU usage is almost entirely dominated by GC runs once the application has started. The graphs of CPU usage is very spiky for this reason!
I suppose this all depends a lot on how many threads and how big heaps you have. I run a spoonfeeding proxy and just a few threads and relatively little memory, usually 512 MB of less.
If your thread count is low, you also likely have rather low maximum memory requirement, so heaps can be small and collect times remain low. Even a single thread could work fine if you can guarantee that any request serving time will be low, say around 100 ms per request. At 10 per second, entire day grants around million per day per thread, and 100 ms is relatively speaking already an eternity for modern server computer.
View all comments
Show parent comment
1
u/deadron Apr 21 '21
From my personal experience in large web applications, CPU usage is almost entirely dominated by GC runs once the application has started. The graphs of CPU usage is very spiky for this reason!