If the total number of containers in your host is more than CPUs number, and there are many 'threads
' running inside each container it is better to give just a single VCPU to each container.
In this case thread memory locality will significantly reduce overhead on SMP memory coherence and overall performance can be increased up to ~50-100%!
To set the number of CPUs available inside a container, use:
# vzctl set $CTID --cpus N
RHEL 5 based kernel supports IP checksum offload. If network ethernet cards in your host support IP checksum offload then you can switch this feature on also for the virtual network devices (venet, veth).
To check current offload setting for the hardware ethernet card (eth0, for instance) type
# ethtool -k eth0
Make sure that tx/rx features are switched on.
To see current offload settings for the venet0 device, type
# ethtool -k venet0
To set offload settings on for the venet0 device, type
# ethtool -K venet0 tx on sg on
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 container.
Please note, that on container creation the default LANG value will be the same as in the HW node. So you can tune it in node (see hw-node-environment-tuning), or set it in container the same way.
The second important thing is the locale cache. On rpm based distributions, usually it is created by the glibc-common-XXX.rpm post install script and it can be up to 50 MBytes on some distributions. So on some container templates it can be missed to save disk space. But you can always create it inside 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 ~15%.