2 ms·
Is there anything to test here? If your process uses unbounded memory, you have to kill it. If your proc uses blocking calls in the event loop, it's going to
by jrockway 17y ago
Is there anything to test here? If your process uses unbounded memory, you have to kill it. If your proc uses blocking calls in the event loop, it's going to block the whole process until it's done.
No benchmark or special server is going to prevent your code from being bad. So make your code be not bad.
- codexon 17y agoA process monitor or separate thread can check if your request has been stuck for too long and kill it.
- jrockway 17y agoRight, but at this point, you've degenerated to CGI scripts with ulimits. If you want to do better than that, then you are going to have to fix your code.
- ianb 17y agoPHP successfully recovers from memory leaks, runaway processes, and any kind of deadlock. App Engine does too. And so does mod_wsgi. It can be done.
- FooBarWidget 17y agoRecovers? Last time I checked it just kills itself if memory usage goes too high, not sure whether that can be really called recovering.
- jrockway 17y agoYeah, by spawning a new process for every request. Fork is fast, but not forking is faster.
- ianb 17y agoAll of these keep a pool of worker processes, they don't fork each request. With a non-trivial application the speed difference is negligible, though the memory difference is not. PHP also has language-level isolation from request to request, but extensions are still long lived and require the process to be killed in some cases when they misbehave.