Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I have an apache box that runs a bunch of PHP and flat HTML sites. I have to set it to only use 10 processes, and to kill them every half hour, because they all gradually swell up to 35MB each (which I imagine is where they've loaded pretty much all the PHP on my server, independently of each other).

Without the number limit, or the kill policy, the server runs out of RAM and crashes. (it's only a cheap one, with 512MB RAM.) Luckily it's a very low traffic set of sites, so these limits don't break the experience. I'm glad I didn't have to solve this problem any deeper!



Have you enabled the GC? Some default configs disable the PHP GC because it's SOP to run temp startups (eg mod_php) or restart them on a regular basis (like you).


ooh, no, thanks for the tip :)

I haven't had to log in for a while (about a year), so I've been happy to leave it as it is. When I migrate over to DigitalOcean (which I've been intending to do for ages now) I'll look into that instead!


If you just set MaxRequestsPerChild to something pretty low that will cause them to restart on their own pretty frequently.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: