Site Cache faster than Memcache

Source: Internet
Author: User
Tags wordpress cache wordpress cache plugin

The Linux system provides us with the Tmpfs file system, TMPFS can use the memory directly, and use the swap partition to store it when there is not enough memory. It is also important to note that the TMPFS does not have persistence, the data is not retained after reboot, it must be noted, but we only use it to store the cache file, even if the file is lost does not affect the site access, completely risk-free.

/dev/shm/is a device file that uses the Tmpfs file system (note: Under CentOS and Redhat, the/DEV/SHM directory is a link to the/RUN/SHM directory, which corresponds to the Tmpfs file system under the Ubuntu system/run/ SHM directory, you can use the DF command to view), because/dev/shm/this directory is not on the hard disk, but in memory, it is called TMPFS. By command df-h See, tmpfs default size is half of physical memory, of course, can also be adjusted according to the actual situation.

First, create a directory for the wordpress cache file Wpcache
# Mkdir/dev/shm/wpcache
Granting read and Write execution permissions
# chmod 1777/dev/shm/wpcache
Mount Tmpfs to the/cache directory generated by the WordPress cache plugin
# Mount--bind/dev/shm/wpcache/home/wwwroot/amznz.com/wp-content/cache
# Ls-ld/dev/shm/wpcache
Returns a description similar to the following for Mount success
DRWXRWXRWT 3 www www. 22:50/dev/shm/wpcache

The cache plug-in now rebuilds the static paging file, and after a while, the command
# df-h
You can find out the usage of TMPFS.

Site Cache faster than Memcache

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.