Hacker News new | ask | show | jobs
by xorcist 4079 days ago
PHP the runtime was built with a reload on every page load in mind, so a lot of cleaning up simply didn't need to happen. If it's in the runtime or how it's used doesn't matter.

It was a big deal when transitioning to the FPM runtime. That's why persistent PHP runtimes like FPM still have the option to completely reinitialize itself after a set number of pageviews. It's a bit like fixing leaks by rebooting, but it's fast enough not to be noticeable.

1 comments

Admittedly, the "restart server process after N connections" method of dealing with memory leaks is not specific to just PHP.

It's also present in Apache, and thus mod_rails and mod_wsgi, by default[1], is an option in Gunicorn[2], and a gem is also available to provide the same in Unicorn.[3]

1 http://httpd.apache.org/docs/2.2/mod/mpm_common.html#maxrequ...

2 http://gunicorn-docs.readthedocs.org/en/latest/settings.html...

3 https://github.com/kzk/unicorn-worker-killer