Staggering java linux process startup to prevent OOM
Posted
by
ctennis
on Server Fault
See other posts from Server Fault
or by ctennis
Published on 2010-09-16T11:14:38Z
Indexed on
2011/01/11
21:55 UTC
Read the original article
Hit count: 264
I am running a number of java processes on a single Linux machine. From a memory and computing standpoint, everything is fine when things are static.
However, periodically we use a configuration management package up upgrade the jar or war files, and restart the java process.
The problem is, that is restarts them all relatively quickly, and so we get 10 or so java VMs restarting all at the same time (we use daemontools for the service stops/starts), which wreaks havoc on the machine, in terms of OOMs or just really slow. This is because it's spawning the JVM 10x at the same time.
Other than trying to stagger the startups, is there a smarter way of handling this? Maybe a sysctl tuning performance parameters, or a JVM parameter?
© Server Fault or respective owner