3 ms·
> The catch is, if you trim Apache down to do only what you need, the margin between it and Nginx becomes much smaller. If you really know Apache well, then you
by sirn 16y ago
> The catch is, if you trim Apache down to do only what you need, the margin between it and Nginx becomes much smaller. If you really know Apache well, then you don't necessarily need to switch to Nginx, just because it's hot and new.
Care to elaborate? I used to do that few years ago for static serving, from tuning Min/MaxSpareServers, measuring resource usage and speed of worker/prefork MPMs to strip out all modules to bare minimum and I still can't get the margin between Nginx and Apache to be any close.
- deleted 16y ago[deleted]
- sirn 16y ago> The margin by what metric? My Apache processes are less than 500KB each. Resource usage in high active connections situation. I remembered I got it that low back then, but isn't the number raise by each active connection? 1000*500KB is 500MB. Nginx stays at 3MB.
- bradleyland 16y agoSorry, I deleted the parent because I replied at the wrong tier, but at any rate. Yes, with pre-fork MPM each connection gets its own process [1]. You don't need a 1:1 ratio of process to concurrency though. That's just silly. Yes, Nginx is more resource frugal (especially RAM), but you can serve a whole lot of visitors with Apache using 30-50 MB of RAM, which isn't prohibitive, depending upon your needs. To re-state it: I am not claiming that Apache is a better web server than Nginx, and I do think that every Apache admin should look at and understand Nginx, because it's a different beast, and it just might fit your needs better. But I talk to a lot of really ill-informed people who look at the output of `top` and think that each Apache process is consuming something crazy like 17 MB of RAM a piece. This is generating the perception that default answer is to move away from Apache to something else entirely. That's a wrong-headed way of looking at the problem. 1 - The author's suggestion to turn off keep-alive is a good one in memory restricted environments, btw. This prevents long-running connections that tie up memory.
- Daniel_Newby 16y agoHow are you measuring resource consumption? Memory consumption often includes a lot of shared virtual memory, where multiple Apache threads/processes simultaneously use the same physical memory.
- sirn 16y agoResident size. Normally ps -o rss,ucomm