4 ms·
Depends. I remember having an issue with an apache/mod_php app that was using way too much memory. The app was doing polling every 10 seconds and apache had a
by byroot 12y ago
Depends. I remember having an issue with an apache/mod_php app that was using way too much memory.
The app was doing polling every 10 seconds and apache had a 15 seconds keep alive. So each user of the app was maintaining an apache process alive.
Disabling the keep-alive was not acceptable, so I just threw nginx in front to do the keep-alive, memory usage was immediately reduced by ~75%.
If I knew apache better I might have been able to do it with just apache, but nginx is so simple to use...
- mgkimsal 12y agowouldn't just changing the apache keep alive have been even easier than setting up a whole other web server and adding that to the mix? If the nginx keep alive was set at 15 seconds, you'd have had a similar problem, no?
- seunosewa 12y agoNo. Because Nginx doesn't dedicate a thread or process to each open connection.
- jebblue 12y agoDoesn't that raise security concerns?
- marcosdumay 12y agoYes, it requires a sandbox for things like PHP. But it's limited to it. Most other web stacks come with their own sandbox. And Apache also puts PHP in a sandbox for unrelated issues.