Remove OpenVZ limits

Posted in: Virtual Private Servers (VPS) |

Below are a quick set of commands which may be useful to those needing to quickly remove some of the more important limits on a VPS. I have found them extremely valuable when deploying OpenVZ in a load balanced or otherwise very busy environment. Note the –save will save them in the configuration file for when you restart it. If you do not supply the argument then when the VPS is restarted the settings will be lost.

 

To check the current status and see what, if anything, is being maxed out. IMPORTANT just because I do not list something does not mean it is important. If you see something else that is near the limit use the same syntax as is below to raise the limit.

clear; cat /proc/user_beancounters

vzctl set 101 –tcpsndbuf 999999999:999999999 –save
vzctl set 101 –tcprcvbuf 999999999:999999999 –save
vzctl set 101 –numtcpsock 999999999:999999999 –save
vzctl set 101 –numflock 999999999:999999999 –save
vzctl set 101 –othersockbuf 999999999:999999999 –save
vzctl set 101 –numothersock 999999999:999999999 –save
vzctl set 101 –numfile 999999999:999999999 –save
vzctl restart 101

Some errors that you may have received without these limits being raised:

[crit] (105)No buffer space available: alloc_listener: failed to get a socket for 127.0.0.1

Leave a Reply