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 &nbs p; tmpfs noexec,nosuid,nodev   ; 0 0
tmpfs /var/lib/php/session &nbs p; tmpfs mode=770,gid=48,size=500M,noex ec,nosuid,nodev,noatime & nbsp; 0 0
Note: default folder permission of "/var/lib/php/session" is 770 and set to the apache Group ID.
- sandip's blog
- Login or register to post comments
Comments
If placing folders inside of the tmpfs mount, make sure to add to "/etc/rc.local" file, so the folder gets recreated on server reboot.
In "/etc/rc.local":
# Magento sessions ento/" ] && sudo -u apache mkdir /var/lib/php/session/magento/
[ ! -d "/var/lib/php/session/mag