To check used and unused ram and swap space on XEN or OpenVZ VPS is easy. The free command provides information about ram usage on VPS running Linux or another Unix-like operating system. The basic syntax of free is
1 | free [options] |
Free accepts no arguments (i.e., input data) and is commonly used without any options. Below is the example of free command on a XEN VPS
1 | free |
Another example of free command on a OpenVZ VPS
1 | free |
Some people might question Xen ram usage. Is XEN VPS used up most of the ram? No worry, your ram is fine! XEN VPS is more like a real dedicated Linux server. Linux system will borrow unused ram for disk caching. This makes it looks like you are low on ram. Xen in their work makes a connection between the environment of OS and the server hardware. OpenVZ creates a virtual server as a layer that runs on another operating system.The model of ram allocation between XEN VPS and OpenVZ is different. Xen provides better isolation and dedicated ram, OpenVZ uses a shared kernel approach so resources are more shared. To put it in simple, for OpenVZ VPS, the most important information for free ram is the first row’s free value
For XEN VPS, the free ram available is the second row’s free value, - buffers/cache is the “used”, + buffers/cache is “free” Several options are available to change the unit of display for free from its default kilobytes, including -b for bytes, -m for megabytes and -g for gigabytes. Of these, -m is usually the most useful. Thus, for example, to show all of the data in megabytes, the following would be used:
1 | free -m |
Comments