Occasionally you find yourself off in the weeds looking for a problem that doesn't appear to have been reported by anyone. Such was the case recently with Sun's JDK 1.4.2 for Solaris 8. It has one quirk which really hurt.
We've got an application that needs to handle a few thousand UDP connections per second (and do something useful with the data). During testing under the conditions above, the application was dropping an unacceptable number of packets. Move the application elsewhere, including a windows laptop (which at least one person is going to enjoy mightily) and it seemed to be able to handle the load as required. Weird stuff. Mucho head scratching all around.
Eventually, the engineer responsible for making this all work tumbled to the fact that the java process was being renice'd to 10 some time after application startup (which is really annoying.. why do it later?) We checked several dual CPU systems running 1.4.2_04 and all the java processes were running at nice value of 10. Renice the application to 0 and our performance characteristics are within spec.
We failed to find anything to explain it this afternoon, but this evening I found this: Solaris 1.4.2 JVM changes its nice level automagically? That leads to two questions.
I can't answer either, but if you are having performance issues with a java based application running under Solaris, check the nice level (prstat -a seems to be the easiest way) of your application.
Posted by Dave at September 23, 2004 11:20 PMWe just discovered the same problem, running tomcat on solaris 9. If you resolved this problem, I'd be all too interested in your solution.
Posted by: Bernd Haug on January 14, 2005 03:23 AM commLinkBernd,
My bad for not responding earlier... it took comment spam for me to notice. Sorry.
We've asked our SA's to create a generic renice script that gets run as part of the standard init.d application startup. The general idea is to wait a bit (usually less than a minute) and when the nice level pops to +10, renice to 0 and exit.
I'll see about getting some more specifics.
Posted by: Dave Ely on January 20, 2005 12:13 AM commLinkfound this: -XX:JavaPriority5_To_OSPriority=127
on bugs.sun.com: prstat shows that the java process is running with nice 10, rather than nice 0
works on Solaris 9 / JDK 1.4.2
Posted by: Hendrik on June 7, 2005 08:33 AM commLinkThat's a terrific find, thanks very much.
This note is also related: Bug ID: 4910535 -XX:-UseThreadPriorities does not totally disable priority setting.