2

How can I monitor health of Jetty instance and automatically restart instance, if it runs out of memory?

quanta
  • 51,413
  • 19
  • 159
  • 217
newbie
  • 355
  • 2
  • 4
  • 16

1 Answers1

2

I would look at something like Monit to watch the process and set a memory threshold for restarting the process.

Using Monit, you can have a statement like:

check process jetty
    with pidfile "/var/run/blah...
    start program = "/path/to/start_script"
    stop program = "/path/to/stop_script"
    if mem usage > 95% for 11 cycles then restart
ewwhite
  • 197,159
  • 92
  • 443
  • 809