Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wordpress w3total cache: Disk, Opcache or memcache

I have a wordpress site that has about 200.000 pages views everyday. I run this on a VPS with 6GB ram. I have w3total cache installed right now but the page is still loading slow.

What i am wondering now is what cache should i use for my site Disk, Opcache or memcache, and should i use one on alla or how should i set it up? currently i am using basic disk cache only.

My question is basically, should i change anything, and if yes to what? or should i just stick with basic disk caching as is ?

I have not yet tried to change anything so i dont make it worse as i am quite unsure.

like image 318
Rizzzler Avatar asked Sep 19 '14 12:09

Rizzzler


1 Answers

The answer to this question is effectively 7 years old, so I'll update the answer here. Please note that I am assuming that you are using W3TC for your website.

Disk Cache

Disk cache can generally be used for website with low/medium traffic. One of the problems with high traffic website is that Disk Cache gets corrupted if you use it with Object Cache and Database Cache.

On a medium/high traffic website running on a single server I would recommend the following:

  • Page Cache : Use Disk Cache Enhanced
  • Object Cache : Use Memcached
  • Database Cache : Use Memcached

OPcache

OPcache stores the compiled PHP code in the memory and definitely increases the code execution speed.

It is important to understand that the OPcache is a PHP Code Cache and does not store any pages, database queries or objects.

You can read more about OPcache here:

https://www.sitepoint.com/understanding-opcache/

MemCached

Memcache stores data in the RAM as key-value pairs and definitely improves the speed of the website as accessing the memory is much faster than accessing the Hard Disk.

Please note that MemCached will increase your memory usage significantly so it's definitely worth trying different configurations on test environment.

You can read more information on how to install Memcached on a Linux Server here: https://easyengine.io/tutorials/php/memcache/

Hope this will help :)

like image 91
veggito Avatar answered Oct 12 '22 00:10

veggito