
Managing Resources
62
Validating Virtual Private Server Configuration
The system resource control parameters have complex interdependencies. Violation of these
interdependencies can be catastrophic for the Virtual Private Server. In order to ensure that a
Virtual Private Server does not break them, it is important to validate the VPS configuration file
before creating VPSs on its basis.
The typical validation scenario is shown below:
# vzcfgvalidate /etc/sysconfig/vz-scripts/101.conf
Error: kmemsize.bar should be > 1835008 (currently, 25000)
Recommendation: dgramrcvbuf.bar should be > 132096 (currently, 65536)
Recommendation: othersockbuf.bar should be > 132096 (currently,
122880)
# vzctl set 101 --kmemsize 2211840:2359296 --save
Saved parameters for VPS 101
# vzcfgvalidate /etc/sysconfig/vz-scripts/101.conf
Recommendation: kmemsize.lim-kmemsize.bar should be > 163840
(currently, 147456)
Recommendation: dgramrcvbuf.bar should be > 132096 (currently, 65536)
Recommendation: othersockbuf.bar should ba > 132096 (currently,
122880)
Validation completed: success
The utility checks constraints on the resource management parameters and displays all the
constraint violations found. There can be three levels of violation severity:
Recommendation This is a suggestion, which is not critical for Virtual Private Server or
Hardware Node operations. The configuration is valid in general; however,
if the system has enough memory, it is better to increase the settings as
advised.
Warning
A constraint is not satisfied, and the configuration is invalid. The Virtual
Private Server applications may not have optimal performance or may fail
in an ungraceful way.
Error
An important constraint is not satisfied, and the configuration is invalid.
The Virtual Private Server applications have increased chances to fail
unexpectedly, to be terminated, or to hang.
In the scenario above, the first run of the
vzcfgvalidate
utility found a critical error for the
kmemsize
parameter value. After setting reasonable values for
kmemsize
, the resulting
configuration produced only recommendations, and the Virtual Private Server can be safely run
with this configuration.