Linux VPS memory how to see

  
                  

Many VPS users have misunderstandings about the memory usage of the Linux operating system. We often explain to customers how to look at the memory usage of a Linux VPS, as summarized below:

The most convenient command to read memory is Free -m, run on my VPS, the result is as follows:

[root@host ~]# free -m total used free shared buffers cached Mem: 1024 1005 19 0 9 782 -/+ buffers/cache : 212 811 Swap: 996 0 995 [root@host ~]#

Obviously, this VPS has a total of 1024M of memory, yes!

But what is the memory that the current VPS has taken up? The answer for most users is 1005M, which is not the case. The current VPS memory should be 212M, which is the number below 1005: 212, which represents the memory already occupied. The latter 811 represents the available memory of the current VPS. The line at the beginning of "-/+ buffers/cache:" is the actual occupied memory and available memory.

Why is this? This is determined by the memory management mode of the Linux Kernel. Buffers, cached can be regarded as memory used by programs or kernels. These memories have been used, but they have been released. After release, Linux Kernel treats them as Buffers or cached, so that the next time there is a program to apply for memory, the kernel can respond quickly. So the buffers and cached parts of the memory should be considered as available memory.

So, look at the memory usage, you should look at the line at the beginning of "-/+ buffers/cache:", if the last digit of this line is close to 0, then the memory of the VPS is running out, this The VPS reaction is slower. If this number is still relatively large, then the VPS has more memory available and the system should not be slow.

Copyright © Windows knowledge All Rights Reserved