Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

Performance tuning

70 bytes added, 11:05, 11 March 2008
m
Robot: Automated text replacement (-VE +container)
= Container tuning =
== CPU distribution inside VE container on SMP hosts ==
* If the total number of VEcontainer's in your host is more than CPUs number, and there are many '''threads''' running inside each VE container it is better to give just a single VCPU to each VEcontainer.
In this case thread memory locality will significantly reduce overhead on SMP memory coherence and overall performance can be increased up to ~<font color=red>50-100%</font>!
To set the number of CPUs available inside VE container use:
# vzctl set $CTID --cpus N
Note, that 'tx on/off' enables/disables both tx and rx checksumming features for the all venet devices for all containers and HN.
The same applies to the veth device except that 'tx on/off' enables/disables tx and rx checksumming features for only given virtual ethernet device in HN and corresponding VEcontainer.
== Shell scripts performance improvement ==
Please note, that on VE container creation the default <code>LANG</code> value will be the same as in the HW node. So you can tune it in node (see [[#Shell scripts performance improvement]] above), or set it in VE container the same way.
The second important thing is the locale cache. On <code>rpm</code> based distributions, usually it is created by the <code>glibc-common-XXX.rpm</code> post install script and it can be up to 50 MBytes on some distributions. So on some VE container templates it can be missed to save disk space. But you can always create it inside VE container later by the following command (you must be the root user):
# build-locale-archive
And again, in some cases shell (bash) startup time can be reduced up to ~<font color=red>15%</font>.
2,253
edits