How often should Apache and MySQL be restarted?

How often should Apache and MySQL be restarted (in particular having 150K hits/week), and what would be the actual benefit in restarting every certain time?


If your system is properly tuned and your application doesn't have any issues like memory leaks, you should only ever have to restart them to apply patches.


Apache and MySQL by themselves should be free of memory leaks. Most databases servers run better the longer they have been up. However, modules which are compiled into Apache like PHP often have memory leaks.

The Apache mpm module automatically recycles processes after 10,000 requests. You can change the MaxRequestsPerChild to something different, but 10,000 is a reasonable default.