Browse help topics

Server Management

How to Check Your VPS CPU, Memory and Disk Usage

Over SSH, run top for CPU and the busiest processes, free -h for memory and df -h for disk space. Compare the load average with your number of CPU cores, and look at the “available” memory column rather than “free”.

  • Updated
  • Last reviewed
  • Beginner
  • About 10 minutes

Applies to: Linux Blue Arctic VPS Hosting and Virtual Dedicated Servers (VDS)

On this page
  1. CPU: top
  2. Memory: free
  3. Disk: df
  4. How to tell it worked
  5. Troubleshooting
  6. Still need help?

When a site on your VPS is slow, start by checking three things: the processor (CPU), memory (RAM) and disk space. The commands below only read information; they don’t change anything.

CPU: top

Warning

top reacts to single key presses. Press only the keys listed here: Shift+P, Shift+M and q. Some other keys change or stop programs; for example, k can end a process. If top asks you a question you didn’t expect, press Esc.

  1. Run nproc. It prints how many CPU cores your VPS has.
  2. Run top. It fills the window and updates every few seconds; that’s normal. You can press q at any time to leave it.
  3. Read the load average at the end of the first line, for example load average: 0.52, 0.48, 0.40. These are averages for the last 1, 5 and 15 minutes. If nproc said 2, a load that stays above 2 means work is queuing.
  4. Press Shift+P to sort by CPU, or Shift+M to sort by memory. The busiest processes are at the top.
  5. Check two values in the %Cpu(s) line: wa is time spent waiting for the disk, and st is time your server waited for the physical machine it runs on. If st stays well above 0 for several minutes, note the time and the value and tell us in a support ticket.
  6. Press q to leave top.

One process can show more than 100% CPU; that means it’s using more than one core.

Memory: free

  1. Run free -h. The -h shows sizes in easy units, such as G for gigabytes.
  2. Look at the available column, not free. Linux uses spare memory as a cache and gives it back when programs need it, so a small “free” figure is normal.
  3. Look at the Swap line (swap is disk space used as extra memory). Steady, growing swap use alongside low available memory means the server is short of RAM.

Disk: df

  1. Run df -h. Find the line whose last column is /; Use% shows how full the main disk is.
  2. Run df -i and read IUse% on the / line. This counts files instead of space. A disk can be “full” because it has too many small files, even with gigabytes free.

If either figure is above about 90%, act soon: see how to find large files and fix a full disk.

How to tell it worked

You have four readings: the load average against your number of cores, available memory, and the disk’s Use% (space) and IUse% (files). Note them with the time, so you can compare them when the problem happens again.

Troubleshooting

  • One process uses most of the CPU: note its name in the COMMAND column. Web server and PHP processes often have names like httpd, litespeed, lsphp, nginx or php-fpm; databases often mysqld or mariadbd. A busy or misbehaving site is the usual cause. If one seems stuck, see how to restart a Linux service.
  • Memory is always low and swap keeps growing: the VPS may need more RAM. Adding RAM is a plan change; open a support ticket to ask about it.
  • A process you don’t recognize is busy: don’t stop it yourself. Open a support ticket with its name.
  • Your site is down rather than slow: see Website Is Down or Not Loading.

Still need help?

Open a support ticket from the Client Portal at my.bluearctic.com. Our support page explains how the 24/7 helpdesk works. Include your VPS IP address, when it was slow, and the output of uptime (it prints the load average), free -h and df -h. Never include a password or a private key.

Was this article helpful?

Report outdated instructions or suggest an improvement
Type of report

Please do not include passwords or personal information.

Still need help?

Our support team can look into your account and walk you through it.