With any Linux-based from Hostwinds, there may be a need to monitor your processes. htop provides you with an interactive way to monitor your processes for your server and can be used with any Hostwinds Cloud VPS server.
This guide will go over using htop on a Hostwinds Cloud VPS server running CentOS.
CentOS Install HTOP command line performance monitoring
What is HTOP?
htop is a command-line interface to check and monitor your servers performance. Essentially it is a dashboard that combines a number of different types of Linux commands to represent them in groups within this dashboard. Items such as CPU load, Memory usage overall, swap usage, tasks running, load averages, system uptime, and currently running processes. One of the nice things about Htop is that it accomplishes the goal of many command-line tools already within Linux. Htop is customizable which means you can change what is displayed and customize it to your needs.
Why Use Htop?
A lot of VPS users will install Webpanels such as CentOS Web Panel, VestaCP, and Virtualmin to manage their server via the web browser and SSH to the server accessing the command line. Having access to a visual aid in the command line can be a very insightful tool when monitoring your server, especially when trying to communicate potential issues to others in technical support roles, not to mention other interested stakeholders.
Step One: Select, Copy, and Paste this command set into your terminal session while logged in
sudo yum -y install htop
Step Two: Enter your password when prompted
Step Three: Now that the installation is complete, type htop and press enter
Step Four: You now have htop installed by the looks of it, great job. Htop will also work for regular users.
Notice all the F key functions at the bottom of the screen.
As pictured above htop has many options
In the F1 window we see there are many shortcut keys to work with:
Arrows – These up and down keys allow you to scroll up and down.
Digits – As in number keys allow you to type in a PID number to search
F3 – Incremental name search
F4 – Incremental name filtering
F5– Toggle Tree view
t – tree view
p – toggle search path
H – hide or show user process threads
K – hide or show kernel threads
F – hide/show kernel threads
F6 + or – expand and collapse tree
P M T– sort by CPU%, MEM%, or TIME
I – invert sort order
F6 > . select sort column
Space Bar– Tags a process
C – tags process and all of its children
U – untag all processes
F9 k – kill processes or tags processes
F7 ] – higher priority (only works when logged in as root user)
F8 [ – lowers priority of process just like (+nice)
a – sets a CPU affinity
e – shows the processes environment
i – lowercase sets IO priority
I – capitol lists open files with lsof
s – trace syscalls with strace
F2 C S- setup
F1 h – show this help screen
F10 q – quit
F7 and F8 to change the Nice values, what does that mean?
A Linux nice value is a priority value with -20 being the highest and 19 the lowest priority.
The nice command allows you to manually manage the CPU scheduling priority of each process.
Selecting F10 will exit Htop back to the command prompt.
- How to Change Your MySQL Password in Ubuntu 14.04(Opens in a new browser tab)
- How to Change Your Password in Windows Server 2008(Opens in a new browser tab)
- How to install Bind on Ubuntu 16.04(Opens in a new browser tab)
- How To Change File Permissions(Opens in a new browser tab)
- How To Manage The Module Queue In WHMCS(Opens in a new browser tab)
- WordPress Security and Hardening(Opens in a new browser tab)
- How to Install cPanel on your VPS(Opens in a new browser tab)
- Monitoring Tools For Windows(Opens in a new browser tab)
- Cloud Control Overview(Opens in a new browser tab)
- Getting Started With A Hostwinds VPS