What is User Beancounters? UBC Parameters?
By Jithin on February 27th, 2017
The User Beancounters are inevitable parameters of containers. They are as important because they will affect the server performance if the limit is reached. In this article, we are going to see about the User Beancounters in detail.
What are User Beancounters?
These limits are controlled by each of the containers in the node. The container should not hit these limits. When the limits are hit, it may cause various issues to the server. The User Beancounters are also known as the UBC parameters. We provide OpenVZ, KVM and Hyper-V virtualization platforms for our VPS’. These three platforms have their own advantages and disadvantages. Hyper-V is only for Windows and OpenVZ can have only host Linux VMs, However, KVM supports both Windows and Linux based Virtual Private Servers. KVM is a platform that is based on the Kernel-based virtualization technology where OpenVZ is based on the System Level Virtualization. That’s why you can get a Mac address for a KVM VPS unlike in a OpenVZ container. A virtual machine (VPS) in an OpenVZ node is also called a container.
We’ve just seen an overview of the three virtualization platforms we offer. Now let’s see how it is related to the User Beancounters. The User Beancounters are present for an OpenVZ container. There will be many parameters which define various properties of the system. Each parameter will be set with a predefined limit. When the container is running, it should not hit these limits because it may affect various services. Sometimes, it could affect the whole server.
How to view UBC Parameters?
The User Beancounters are stored in a file under the “/proc” directory. Usually the full path will be “/proc/user_beancounters”. To read the file, please run the following command.
# cat /proc/user_beancounters
Now the file will be opened and a sample output is provided below.
# cat /proc/user_beancounters Version: 2.5 uid resource held maxheld barrier limit failcnt 123: kmemsize 836919 1005343 2752512 2936012 0 lockedpages 0 0 32 32 0 privvmpages 4587 7289 49152 53575 0 shmpages 39 39 8192 8192 0 dummy 0 0 0 0 0 numproc 20 26 65 65 0 physpages 2267 2399 0 2147483647 0 vmguarpages 0 0 6144 2147483647 0 oomguarpages 2267 2399 6144 2147483647 0 numtcpsock 3 3 80 80 0 numflock 3 4 100 110 0 numpty 1 1 16 16 0 numsiginfo 0 1 256 256 0 tcpsndbuf 0 0 319488 524288 0 tcprcvbuf 0 0 319488 524288 0 othersockbuf 6684 7888 132096 336896 0 dgramrcvbuf 0 8372 132096 132096 0 numothersock 8 10 80 80 0 dcachesize 87672 92168 1048576 1097728 0 numfile 238 306 2048 2048 0 dummy 0 0 0 0 0 dummy 0 0 0 0 0 dummy 0 0 0 0 0 numiptent 10 16 128 128 0
This is a sample user_beancounter file. Now we are going to take a look at the output.
Fields of the user_beancounter file
The “uid” is the first field of the file. It is an identifier that represents the container id. It will be a numerical value always.
The second field is “resource” and it represents the resource name. The resources include kmemsize, numsiginfo, tcprcvbuf, etc.
The next field is “held” It is valid for accountable parameters. The “held” value shows the current counter for the container. This counter value represents the usage of the particular resource by the container.
The maxheld is the maximum held value of the resource for the current period. Usually the accounting period will be the lifetime of a container.
The “barrier” and “limit” fields
The “barrier” and “limit” fields are the configurable fields for a parameter used to configure the parameter. The both fields are similar, but the exact meaning of the field will vary according to the parameters. ie., the meaning of these fields may be different for various parameters.
The “failcnt”, called fail count will provide us the number of refused allocations for the particular resource. It means the hits of the limit.
We have seen the fields of the user_beancounters. Let’s now see some of the important parameters that you should know.
The “kmemsize” is the resource that represents the size of the memory allocated to the container by the system kernel. Note that the This memory is the memory that is unswappable. This includes all of the kernel internal data structures that are associated with the container, but some of the network buffers will not be included. These data structures will be usually present in the first gigabyte of the RAM, called “low memory”.
The shmpages stands for shared memory pages. The user mode processes will use Interprocess Communication. The shared memory pages is used for this purpose.
The “numproc” is the value for the maximum number of processes including the threads allowed for a particular virtual machine.
The “physpages” stands for the total number of RAM pages for a particular container. When this exceeds the limit will be hit.
If you need any further assistance please contact our support department.