Glassfish Asynchronous only using 2 cores out of 4. How can I tell it to use all 4? Or at least 3?
Ubuntu quad-core glassfish install. I would like to tell glassfish to use all 4 cores to process async jobs because it is only using 2 right now. I can't find any setting to specify that though. Do开发者_Go百科es anybody know where that might be?
I don't know Glassfish, but the points are still valid:
You didn't mention what the worker threads are doing, or what version of Glassfish you're using ...
If the worker threads are not doing much, it's possible you aren't pushing requests to the web server hard enough If that is the case, I suggest that you add some Thread.sleeps in the servlets just to see... If not, try the following...
There's also a JMX interface... have a poke around in there, you might find that the worker pool size is for only 2 threads...
Just a guess...
As an answer to anyone wondering, it seems that inside the scope of a request/stateless bean, Glassfish doesn't spin off new threads. So they will all execute on the same, even if set to async. Seems weird, but that is a consistent behavior. However, if I make new calls to services, rather than spinning off new threads inside the same service, it works great.
精彩评论