

After all, seeing a process labeled rails runner "n" is much more helpful than if it was labeled just ruby.įinally, once you've got top set up the way you like, press W on the main screen of top to save your top configuration. The c command lets you tell top that you want to see the command used to start a process instead of the program's name. The default way top displays process names has the annoying habit of displaying all Ruby processes as "ruby" regardless of if it's a rails app process, a rails runner process, or a delayed job process. Top has two different ways to display process names. It gives me a really easy way to see how much memory my server is using and how close it is to having to start using swap. I prefer the display with the filled-in memory gauge. When in the main screen in top, press m to toggle through the memory gauge displays. To sort processes by memory used, run top, press f, use the arrow keys to highlight MEM, press s to set the sort order to memory, and press q to return to the main screen in top. To monitor the memory usage on my server I configure top to sort processes by memory used, display a gauge showing consumed memory, and show the process names of each process. Top is an endlessly configurable process viewer. The best way to figure out which processes are using the most memory on your server is with top. To learn more about Ubuntu, check out Ubuntu Unleashed 2017. The instructions below assume you're running your production server on Ubuntu. In that case, you're going to want to know how to pinpoint your memory-hogging processes. Are you running a Ruby on Rails web app? If you are, you're probably going to run into memory problems sooner or later.
