openvz tmpfs and dcachesize

When using tmpfs inside OpenVZ containers, make sure to monitor and increase dcachesize (directory and inode entries) appropriately.

tmpfs mounts can be used to speed up applications doing lots of read/writes to temporary diskspace such a php sessions and mysql tmp directory.

Mount using "/etc/fstab":

tmpfs   /dev/shm        tmpfs   noexec,nosuid,nodev   0 0
tmpfs   /var/lib/php/session    tmpfs   mode=770,gid=48,size=500M,noexec,nosuid,nodev,noatime     0 0

Note: default folder permission of "/var/lib/php/session" is 770 and set to the apache Group ID.

Syndicate content