1

I'm running Jenkins CI on an Ubuntu EC2 micro instance (it's the only thing running).

Every so often, OOM killer strikes, which is a real pain (I've already configured jenkins memory usage to a bare minimum).

Can I use supervisor (or similar?) to spin up jenkins again?

If so, what would the supervisor run script look like?

1 Answer 1

3

The following will restart the service if it ends abruptly AND force an allocation of 512M of RAM for the java VM. Adjust accordingly to maybe .5 or .75 of your RAM. You need some idle RAM to cache all the workspaces.

[program:jenkins]
command = /usr/bin/java -Xms512m -Xmx512m -Xmsn512m -server -Djava.net.preferIPv4Stack=true -jar /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080 --ajp13Port=-1
stdout_logfile = syslog
redirect_stderr = true
user = jenkins
2
  • Thanks! For anyone else - make sure you've created the dir /srv/jenkins or it will exit with status 127.
    – robmcvey
    Nov 1, 2013 at 9:58
  • Good catch. It actually isn't required, so I removed it from the answer. Nov 1, 2013 at 12:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .