Search code examples
javamultithreadingasynchronousglassfishejb

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. Does anybody know where that might be?


Solution

  • 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.