[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: To supervise or to not supervise?



Scott Gifford <sgifford@xxxxxxxxxxxxxxxx> wrote:
> you don't have to remember to use apachectl for Apache, kill
> qmail-send manually for qmail, send a HUP signal to inetd.

It also ensures that signals (for shutdown, or anything else) are sent
to the right processes.  There's no race condition between reading a
pid file and sending the signal.

> And especially on Linux with its out-of-memory killer, sometimes a
> process can die for no good reason and needs to be restarted.

I don't know when this was added, but with modern kernels you can
disable memory overcommittment to stop the OOM killer:
echo 2 > /proc/sys/vm/overcommit_memory

I also use this, so physical RAM is effectively just a cache of swap,
and doesn't count as extra allocatable space:
echo 0 > /proc/sys/vm/overcommit_ratio
Don't make the mistake I made - at boot, call swapon before setting
overcommit_ratio, and at shutdown, reset overcommit_ratio to something
larger before calling swapoff. :)

> On the other hand, I think there are some general security
> disadvantages to automatically restarting services

Put "svc -o ." in your run scripts.  No more automatic restarting.


paul