WordPress knowledge sharing

The difference between Memcached cache and WP Super Cache cache plug-in and how to choose to use them?

Memcached cache and WP Super Cache Cache Plug in How to choose? Memcached components and WP Super Cache are both used to cache website content. In the process of contacting many users at ordinary times, Weieis Blog learned that many people still confuse the two and use them indiscriminately, resulting in the effect is far less than expected. In this article, Lao Wei explains the difference between the Memcached component and the WP Super Cache cache plug-in, as well as how to select and use them.

1、 Memcached

It is a system component of the Linux system. It is mainly used to turn website content into static content and throw it into memory, and cache data and objects in memory to reduce the number of times to read the database. As we all know, the memory reading speed is several times faster than the hard disk reading process, so that users can access it fastest.

Memcached can only be used on VPS hosts, not virtual hosts.

The related tutorials of Memcached are as follows:

Pagoda panel installation memcached and detailed configuration method

Mistaken Ideas and Correct Methods of Installing Memcached on Pagoda Panels

Multiple methods for real-time monitoring of Memcached hit rate

After Memcached is installed, the effect is obvious. After Memcached is installed, as long as it is accessed, it will throw the accessed page into memory. When the page is accessed again, it will be read directly from memory, and the speed is the fastest.

Memcached uses 64m of memory by default. Generally, there are 1000 articles on the website, which occupies about 20m of memory. The amount of memory occupied depends on the template and the amount of browsing.

2、 WP Super Cache

It is a WordPress plug-in, which caches the web page content (dynamically acquired) in the database into html files and places them on the hard disk, thus forming a transformation from dynamic content to pseudo static content. Reading hard disk content is much faster than dynamically reading the database, so WordPress blogs with cache plug-ins will open faster. But the reading speed of hard disk and memory is still a big difference.

Previously written WP Super Cache Cache Plug in Optimization Setting Process The article, combined with some online suggestions and personal experience, can be used as a reference. Each host is different, so you can refer to the settings.

When the virtual host became popular many years ago, similar cache plug-ins were installed on all WP blogs, which can be said to have a penetration rate comparable to that of Apple phones. In recent years, with the growing popularity of vps hosts, the shortcomings of such cache plug-ins are becoming more and more obvious, and relatively fewer people use them.

Cache plug-ins like WP Super Cache can be used in both VPS hosts and virtual hosts. However, Lao Wei strongly does not recommend using it in VPS hosts, because the efficiency is far less than Memcached components.

If you use a virtual host, you must use this type of cache plug-in to cache website data effectively and improve access speed.

3、 Related questions and answers

1. WP super cache and Memcached have been used for acceleration. Why is the speed still slow?

If you can use Memcached, it means you are using a VPS host. Only one of these two cache accelerations can be used, because both of them play a role in cache acceleration, but Memcached has already been used, and the cache plug-in can no longer be used repeatedly.

There are many different types of WordPress cache plug-ins besides WP Super Cache. This means that Memcached cannot coexist with WordPress cache plug-ins at the same time.

Some students still don't understand. Let's take an analogy. For example, if you hire a security guard and a martial arts expert, they will fight with each other first to compare who is more powerful. Then who has time to protect you? It's also like someone installing 360 Guard and Tencent Security Manager on their local computer and asking me: Why is my computer so stuck? These two goods are going to fight for the control of the system first. They have been beaten to pieces. Who has time to defend and kill your system?

The metaphor is not appropriate. It's OK if everyone can understand the meaning.

2. Does not connecting to the database mean high concurrency is possible? Sometimes the CPU will be full after connecting more than one

When Wei used Memcached himself, he checked that the average CPU usage was not more than 50%, which was pretty good. I used a host with 1M bandwidth, 1 core, and 1G memory.

3. So the website content is thrown into the memory. Is the memory a bit larger? Is there any difference with wp supercache?

Memcached is a system component, independent of the panel, and can only be used for vps; While wp cache is a wordpress plug-in, both virtual host and vps are available, but it is not recommended for vps.

The reason is simple. Wordpress cache plug-in is to generate html files from the content and throw them to the hard disk; The system components throw the contents into the memory, and the user can read the memory contents directly when accessing. As we all know, the memory reading speed is several times faster than the hard disk reading speed, so the efficiency of the wordpress plug-in is far less than that of the Memcached+opcache component.

4. Is the Memcached cache updated during internship?

Memcached cache is triggered when a visitor opens a page. The more times they visit, the faster the page opens. If they do not visit, they will not cache. So don't be afraid of running out of memory. Even if your website traffic is so high that your memory is insufficient, you can increase it manually. Since the cache is in memory, it has nothing to do with the database, so users can read the memory content directly after using the component, and feel that the speed of opening the page is extremely fast.

5. The PHP probe for Memcached is not installed properly. It is estimated that the port or file permissions are a problem, because the amh panel is used. I plan to change it to a pagoda panel in a few days and try again.

Memcached has nothing to do with which panel to use. The probe is also independent. You have to find another reason.

The above is a summary of some netizens' questions about Memcached cache and WP Super Cache cache plug-in, and how to choose to use them. I hope it can help everyone to make their servers run faster through correct configuration methods.

Like( six )
Article name: Differences between Memcached Cache and WP Super Cache Cache Plug ins and How to Select and Use Them
Article link: https://www.vpsss.net/12340.html
Copyright notice: The resources of this website are only for personal learning and exchange, and are not allowed to be reproduced and used for commercial purposes, otherwise, legal issues will be borne by yourself.
The copyright of the pictures belongs to their respective creators, and the picture watermark is for the purpose of preventing unscrupulous people from stealing the fruits of labor.