If you are having trouble running or installing applications on your VPS, one good way to find the source of the problem is to use the special file /proc/user_beancounters which shows the resource control information about running virtual environments.To view /proc/user_beancounters on your VPS, login to your VPS via SSH.In the SSH Terminal you will type:cat /proc/user_beancountersThen hit Enter.After you hit Enter, you should see something that looks similar to the following:
root@srv1 [~]# cat /proc/user_beancountersVersion: 2.5 uid resource held maxheld barrier limit failcnt 10039: kmemsize 5125208 5128321 40098656 44108521 129 lockedpages 0 0 881 881 0 privvmpages 77431 77666 750000 825000 0 shmpages 9051 9051 33324 33324 0 dummy 0 0 0 0 0 numproc 67 67 440 440 0 physpages 44243 44371 0 2147483647 0 vmguarpages 0 0 125000 2147483647 0 oomguarpages 59239 59367 125000 2147483647 0 numtcpsock 37 38 440 440 0 numflock 3 3 704 704 0 numpty 1 1 44 44 0 numsiginfo 0 1 1024 1024 0 tcpsndbuf 79920 88800 4212558 6014798 0 tcprcvbuf 2220 4440 4212558 6014798 0 othersockbuf 19552 91280 2106279 3908519 0 dgramrcvbuf 0 2220 2106279 2106279 0 numothersock 18 20 440 440 0 dcachesize 406435 410022 8750726 9013248 0 numfile 1080 1081 7040 7040 0 dummy 0 0 0 0 0 dummy 0 0 0 0 0 dummy 0 0 0 0 0 numiptent 71 71 512 512 0
That is your /proc/user_beancounters file.If you look at the top line where you see uid to the left of it, that line is the field that displays the numeric identifier of the Virtual Environment.The field held shows the current counter for the Virtual Environment (resource "usage").The field maxheld shows the counter's maximum for the lifetime of the Virtual Environment. The lifetime of the Virtual Environment is usually just the time between the start and stop of your VPS.The barrier and limit fields are resource control settings. For some parameters only one of them may be used, for others, both. These fields may display resource limits or guarantees, and the exact meaning of them is parameter-specific.The field failcnt shows the number of refused "resource allocations" for the lifetime of the Virtual Environment. Failcnt counter is increased only for accounting parameters.The field failcnt is the field you will be looking at for errors.If you look at the example above, you will see that the parameter kmemsize has a failcnt of 129. That is because in this example, the VPS did not have enough memory available to install an application. Therefore, the failcnt counter recorded the 129 memory failures, next to the parameter kmemsize in it's /proc/user_beancounters file. We know the problem was memory since the failcnt next to kmemsize increased after trying to install the application.In this article, we will concentrate on the following parameters: