Every stream has two basic parts
- data-in - A chunk or EOF enters the stream
- data-out - A chunk or EOF leaves the stream
I'm combining both "data" and "end" events since "end" is just a special data packet signifying the end of the stream.
# /etc/monit/monitrc (excerpt) | |
check process node-app with pidfile /var/run/node-app.pid | |
start program = "/sbin/start node-app" with timeout 5 seconds | |
stop program = "/sbin/stop node-app" | |
if failed port 3000 protocol HTTP | |
request / | |
with timeout 3 seconds | |
then restart | |
if cpu > 80% for 10 cycles then restart |