Checking Virtual Server Resource Limits

Some virtual servers are restricted to reduce the number of certain resources. The problem is that these restrictions can sometimes be too much and stop your server from running probably. To check this, use the following command.

> cat /proc/user_beancounters

This shows how many time you have him your maximum limits and had failures (failcnt).

root@server:# cat /proc/user_beancounters
Version: 2.5

       uid  resource                     held              maxheld              barrier                limit              failcnt
    27692:  kmemsize                  6359590              7697013             67108864             67108864                    0
            lockedpages                     0                    8                 2048                 2048                    0
            privvmpages                325931               765475              1179648              1572864                    0
            shmpages                    19457                19473                21504                21504                   12
            dummy                           0                    0                    0                    0                    0
            numproc                        92                  100                  100                  100                   96
            physpages                   27113                55372                    0  9223372036854775807                    0
            vmguarpages                     0                    0               393216               393216                    0
            oomguarpages                27113                55372               393216               393216                    0
            numtcpsock                     16                   24                 5000                 5000                    0
            numflock                       40                   76                  188                  206                    0
            numpty                          2                    3                   16                   16                    0
            numsiginfo                      0                    5                  256                  256                    0
            tcpsndbuf                  280064               486648             20480000             20480000                    0
            tcprcvbuf                  262144              1283992             20480000             20480000                    0
            othersockbuf                59736                70776              1126080              2097152                    0
            dgramrcvbuf                     0                16944               262144               262144                    0
            numothersock                   83                   93                 5000                 5000                    0
            dcachesize                 464805               541843              3409920              3624960                    0
            numfile                      1795                 2065                 5000                 5000                    0
            dummy                           0                    0                    0                    0                    0
            dummy                           0                    0                    0                    0                    0
            dummy                           0                    0                    0                    0                    0
            numiptent                      14                  119                  128                  128                    0

You can see in this example that the server has failures both on the Number of Processes it was allowed to start and also the total size of shared memory.

Primary Parameters

  • avnumproc – The average number of processes and threads.
  • numproc – The maximal number of processes and threads the VE may create.
  • numtcpsock – The number of TCP sockets (PF_INET family, SOCK_STREAM type). This parameter limits the number of TCP connections and, thus, the number of clients the server application can handle in parallel.
  • numothersock – The number of sockets other than TCP ones. Local (UNIX-domain) sockets are used for communications inside the system. UDP sockets are used, for example, for Domain Name Service (DNS) queries. UDP and other sockets may also be used in some very specialized applications (SNMP agents and others).
  • vmguarpages – The memory allocation guarantee, in pages (one page is 4Kb). VE applications are guaranteed to be able to allocate additional memory so long as the amount of memory accounted as privvmpages (see the auxiliary prarameters) does not exceed the configured barrier of the vmguarpages parameter. Above the barrier, additional memory allocation is not guaranteed and may fail in case of overall memory shortage.

Secondary Parameters

  • kmemsize – The size of unswappable kernel memory allocated for the internal kernel structures for the processes of a particular VE.
  • tcpsndbuf – The total size of send buffers for TCP sockets, i.e. the ammount of kernel memory allocated for the data sent from an application to a TCP socket, but not acknowledged by the remote side yet.
  • tcprcvbuf – The total size of receive buffers for TCP sockets, i.e. the ammount of kernel memory allocated for the data received from the remote side, but not read by the local application yet.
  • othersockbuf – The total size of UNIX-domain socket buffers, UDP, and other datagram protocol send buffers.
  • dgramrcvbuf – The total size of receive buffers of UDP and other datagram protocols.
  • oomguarpages – The out-of-memory guarantee, in pages. Any VE process will not be killed even in case of heavy memory shortage if the current memory consumption (including both physical memory and swap) does not reach the oomguarpages barrier.

Auxiliary Parameters

  • lockedpages – The memory not allowed to be swapped out (locked with the mlock() system call), in pages.
  • shmpages – The total size of shared memory (including IPC, shared anonymous mappings, and tmpfs objects) allocated by the process of a particular VE, in pages.
  • privvmpages – The size of private (or potentially private) memory allocated by an application. The memory that is always shared among different applications is not included in this resource parameter.
  • numfile – The number of files opened by all VE processes.
  • numflock – The number of file locks created by all VE processes.
  • numpty – The number of pseudo-terminals, such as an ssh session, the screen or xterm applications, etc.
  • numsiginfo – The number of siginfo structures (essentially, this parameter limits the size of the signal delivery queue).
  • dcachesize – The total size of dentry and inode structures locked in the memory.
  • physpages – The total size of ram used by the VE processes. This is an accounting-only parameter currently. It shows the usage of RAM by the VE. For the memory pages used by several different VEs (mappings of shared libraries, for example), only the corresponding fraction of a page is charged to each VE. The sum of the physpages usage for all VEs corresponds to the total number of pages used in the system by all the accounted users.
  • numiptent – The number of IP packet filtering entries.

Leave a Reply

Your email address will not be published. Required fields are marked *