I've been using a script I found here on the WF support community to keep an eye on my memory management for a while. The command is When I run this, it shows me 8 Nginx worker processes, which is exactly the amount I've configured my private Nginx server to use. However when I run What would account for this discrepancy? Is there a way I should be fine-tuning htop to work correctly in a shared environment that I'm not doing? I'd like to use htop instead of ps for better real-time feedback as I tweak my servers to stay within memory allotments. I need to know it's giving me correct output though. asked 08 Sep '13, 16:42 HittingSmoke |
Hello, By default, the 'ps' command only displays processes. On the other hand, 'htop' shows threads. That's why 'htop' will always show more items than 'ps'. If you want to view per-thread statistics with the 'ps' command, then use the '-L' flag, something like this:
(Note, for memory counting purposes, you would never want to analyze the threads. You would only want to look at the process level, since threads share memory.) Regards, ~Christopher S, WebFaction Support answered 08 Sep '13, 17:06 likebike Interesting. According to the Nginx docs:
I understood uWSGI was not running multiple threads because I have it configured explicitly not to do so. Such an option doesn't exist in Nginx as I thought it was bound to a single thread per process. This is probably going to raise more questions now about optimizing Nginx since it's not running the way I believed it was.
(08 Sep '13, 17:37)
HittingSmoke
|