I'm creating an Java application using a REST front-end, hence must be responsive, and once in a while (X minutes) another service is polling the internet. For this some hundreds of threads are spawned.
Needless to say when hundreds of threads are running the server is slowing down (ie irresponsive). I found an option to supply a setPriority argument to Thread. But also found some flaws, meaning the front-end is pretty much irresponsive, although appears to be better without Java nicing.
So I'm checking my options: 1) nicing threads; 2) nicing a War (found no such option) 3) spawn another tomcat and nice that one, is possible but I would be losing precious resourced. Maybe assign thread pools to a subselection of cores?
My question mainly is some pointers in a helpful directions, preferably for option 1, then 2 etc. Or, of course, something I haven't mentioned, resulting in some dedicated cpu time for other threads.