HostPapa VPS users have a variety of tools at their fingertips for monitoring server performance. If you wish to check your VPS memory usage, you can choose to monitor resources using WHM or the command line.
Check memory usage with WHM
Log in to WHM using your root account credentials. You can check memory usage by navigating to WHM > Server Information or WHM > Service Status.
Check memory usage using the command line
Alternatively, you can log in to your server using a Secure Shell (SSH) and use a variety of commands to track memory usage. To find out more about accessing your server using SSH, read this HostPapa knowledge base document: How to connect to your server via Secure Shell (SSH)
Once you’ve logged in, try the following commands:
This quick and easy tool displays the amount of free memory available. The report includes physical and swap memory, plus buffers used by the kernel.
- Total: the amount of physical swap RAM available.
- Used: RAM consumed by the server and its processes.
- Free: RAM available for the system to use.
- Shared, buffers and cache: memory currently used by the kernel.
You can change the measurement units displayed on screen by adding -m (megabytes) or -g (gigabytes) after the command, as desired.
Note that if you notice your Free memory displaying a low number, the server may be utilizing available RAM for cache. This can be released when required by the system and so may not lead to reduced performance.
The vmstat command displays current virtual memory usage- processes, memory, paging, disks, and CPU information.
The data table displayed can be difficult to understand, at first. It’s split into six columns – procs (processes), memory, swap, io, system, and cpu. These columns are further segmented:
- Procs displays information about processes. The r column displays the number of running processes (or those waiting for run time) while the b columns displays sleeping processes.
- Memory is split into four columns. swpd displays virtual memory used, while free shows idle memory. buff and cache display memory the system has allocated to buffers and cache.
- Swap details the amount of data swapped to and from the disk each second. si shows data swapped to the disk while so corresponds to data swapped from the disk.
- IO allows you to monitor input/output statistics from your drives. bi corresponds to input while bo reports data sent to the drive.
- System comprises two columns. in reports the number of system interrupts per second and cs corresponds to context switches.
- CPU has five columns. us reports usage by user-launched code (rather than system processes) and sy reports usage by the system kernel. id corresponds to idle CPU time, wa is time spent waiting for Input/Output, while st denotes processing time stolen from a virtual machine.
The ps command reports the processes currently launched on the server.
You can add a range of parameters to the command to report on a variety of statistics:
- -e – display processes from all users.
- -o – display statistics in a custom format. Combine with values such as pmem (percentage memory usage), vsz (virtual memory allocation), and others to create more complex queries.
The top (or htop) command supports real-time monitoring of server resource usage.
Use the h or ? keys, once running, to display the help menu. The m key toggles memory-related information while Shift + M sorts processes by memory usage. Press q to stop monitoring.
If you notice any problems or if you need any help, please open a new support ticket from your HostPapa Dashboard. More details on how to open a support ticket can be found here.