UBC failcnt reset
One of the frequently asked question is how do I reset failcnt in /proc/user_beancounters? This article gives a full answer.
Contents
What is failcnt?
There are a number of resource limits (called User Beancounters, or UBC for short) set for a VE. If one of those resources hit its limit, the appropriate fail counter (last column of /proc/user_beancounters
) increases. See Resource shortage for more info.
How to clear failcnt?
You do not need to, and this would be an incorrect thing to do.
There can be many application who reads /proc/user_beancounters
, and thus if you will reset it you gonna have problems with those other apps. Consider what happens if you will reset you sent/received packets/bytes statistics on the network interface — programs which reads will be screwed up.
So, the proper procedure of checking failcnt is not to check whether it is zero or not, but to check whether it is increased since the previous readout. In other words, check the difference, not the absolute value. It is easy to write a simple script to do just that.
OK, I understand, but I still want to clear failcnt!
OK, you can do so by restarting your VE. Since fail counters are for VE lifetime, they will be cleared after VE stop.
The problem here is tcp time wait buckets can still there after a VE is stopped. You can check that by seeing the held
column for kmemsize
parameter. If it is not zero, that means you have to wait about 5 minutes in order to time wait buckets to expire, and the corresponding beancounter to be uncharged.
If you still see failcnt not reset to 0 after more than 5 minutes after VE is stopped, it means there is a bug in UBC code. Please file a detailed bug report to bugzilla.openvz.org