How to Check VPS Memory/RAM Usage with SSH

here are a few tools built-in to most Linux distros for gauging and fine-tuning your server's RAM (memory) usage.

The first is a command called free. To use it, simply run:

# free -m

You will see an output like this:

 

total       used       free     shared    buffers     cached

Mem:           512        462         49          0         46        127

-/+ buffers/cache:        287        224

Swap:         2047          0       2047

The important figure to look at is the "used" number in the "buffers/cache" row. This will tell you how much memory your processes are currently using. Memory allocation errors will occur if this number is higher than the total amount of memory and swap space. To see how much RAM is free, check the "free" column in the "buffers/cache" row.
 
 
Another useful tool is ps, which will show you all of your running processes with RAM usage as a percent of total RAM:
# ps aux
The output will look like this:
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.1  10368   632 ?        Ss   Jan07   0:00 init [3]
root         2  0.0  0.0      0     0 ?        S<   Jan07   0:00 [migration/0]
root         3  0.0  0.0      0     0 ?        SN   Jan07   0:00 [ksoftirqd/0]
 
One of the benefits of a VPS is that, in the case of a memory shortage, you can upgrade RAM on-the-fly with little (Xen) to no (OpenVZ) downtime. Open a support ticket, or find us on live chat, if you need an upgrade!
  • payment
  • 0 gebruikers vonden dit artikel nuttig
Was dit antwoord nuttig?

Gerelateerde artikelen

Install and Run UnixBench on CentOS or Debian VPS

  UnixBench is a popular server benchmarking tool. To install and run UnixBench, just do the...

How to Update cPanel License Key / Run License Script

To run the cPanel License Key update script (perhaps if you've upgraded from a trial license, or...

How to Update VPS Timezone (OpenVZ)

Your OpenVZ will reflect the host server's time settings by default; however, it is possible to...

How to Setup Ruby on Rails for CentOS/Fedora VPS

This tutorial will walk you through the setup of a basic Ruby on Rails environment, including:...

How to Install rTorrent/ruTorrent Seedbox on Ubuntu VPS

This tutorial will guide you through the installation of libtorrent 0.13.0, rTorrent 0.9, and the...

Powered by WHMCompleteSolution