Hi All - We are running JBoss 5.1 on a suse enterprise 2-proc 8GB system.
We have a pretty standard site except for the need to generate PDFs on various pages. Everything is great until the PDF gets built and then the CPU gets hit between 50-100%. This then brings the system to a halt. Doesnt crash, but get very slow to the point of unusable.
Couple questions regarding this:
1. Its a dual cpu box. Even if it is maxed at 100%, dont I have another processor to pick up load. Do I need to do something to config this or should JBoss recognize the 2nd processor and use it automoatically. Any ideas why it is not utilized when other users come into the site.
2. It seems if another external process kicks in on the system (ie I run jmap to check heap), that process is allocated 100% of the cpu and JBoss has no resoruces while this is running. My hope would be that the JBoss process would take priority over any other process on the system. Can it be configured this way?
Hope these questions make some sense. I appreciate any help
Brian, welcome to the forum!
These questions have nothing to do with JBoss AS, rather they are questions about the JVM and the OS. There is nothing in the Java SE API that allows a Java application to assign affinity (lock a thread or process to a given CPU/core).Therefore there is nothing in JBoss AS that you can set to change this behavior.
If you are using the Sun JVM (you never said), there is nothing in the Sun JVM that assigns affinity. This means that by default a Java application will use all available CPUs. I have run Java applications that have used up to 32 CPUs.
I do not know what affinity settings are available in SUSE or how they might be set by default. I recall some discussions a while ago on Solaris and that it managed affinity by default. It also did some throttling so that one process (such as jmap) could not use up the full CPU. I don't think that SUSE has such code.
And then consider the difference in what jmap does versus JBoss AS - jmap, once it loads the heap dump into memory, is purely memory bound and thus will use it CPU time allotment each time it gets the CPU. Threads within JBoss AS, on the other hand, constantly request external resources (wait on HTTP, wait on database, etc) and thus don't use up their allotment. In such a scheme, jmap will get the lions share of the CPU. You could bump the priority on JBoss AS and run jmap (and other things) using 'nice'. Or better yet, don't run jmap on that system - copy the heap dump to another system and analyze it there.