Just to add that with Memcached switched off in the plugin options it is still showing as active in phpinfo.
Hello @confusedneedhelp,
The performance of this feature is largely influenced by the specific website using it, including factors such as the size of the database, the queries, and the results they store. Consider whether these pages are cached and if the cache is being regularly validated. I suggest starting with a query monitor to identify which queries are being executed and how they might be optimized. Please note that we run a Memcached process, and disabling it through the plugin will not deactivate it globally.
Best Regards,
Simeon Boev
Ok, many thanks. I understand now that a memcache process is working even with the plugin option switched off. This makes sense. Is there any technical documentation which explains what switching memcache on in the plugin does extra to the process that is already running?
I have 5 websites which vary greatly in size and theme / plugin make up. All of them are faster with the plugin option switched off so at the moment it seems the best option for me.
Thanks again for your help, it is much appreciated.
The Memcached process is initiated when you enable it from Site Tools > Speed > Caching > Memcached. If it is enabled only in Site Tools but not within your application, the process is simply waiting for input. When you activate the option from the website’s Dashboard > Speed Optimizer > Caching, a drop-in file is created, and the Memcached process begins to actively cache the necessary data. You can find a knowledge base tutorial regarding Memcached on the URL below:
https://eu.siteground.com/tutorials/supercacher/memcached/
Each website’s performance can vary based on its unique configuration, so I am glad to hear that you have identified what works best for you.
Best Regards,
Daniela Ivanova
Hi,
Thanks for your assistance with this. It is appreciated.
I have been doing some more investigation and I now see that the specific query which is being affected by Memcache is an admin ajax query. (My site loads posts and archive filters by admin ajax on page load.) I understand that admin ajax queries are not cached but I was wondering why having Memcache active would slow down this query?
Actual timings for the server response for the ajax query are:
Without Memcache – 869ms
With Memcache – 1.69 secs
These values are very consistent each time I load the page.
Any help or explanation you can offer would be appreciated.
Different applications interact with caching systems like Memcached in various ways, and this interaction can affect performance. Additionally, the themes and plugins you are using can also influence this. They often add custom queries or features that interact with the database, and if not optimized for caching, can lead to inefficiencies.
However, experiencing slower performance with caching enabled is not typical and should be investigated further. We recommend that you conduct a deeper investigation to identify the root cause and optimize your configuration.
Best Regards,
Daniela Ivanova
Ok, would you be able to clarify one more thing please.
Would a database query (e.g. get_posts) called from an ajax function check the memcache storage?
If the answer is yes, is there any way to stop it from doing that?
My best guess is that the queries are being searched for in memcache but do not exist because they are not cached due to being ajax requests.
Alternatively is there a way to store these requests in memcached?
Hello @confusedneedhelp ,
WordPress has a built-in object cache that can be backed by Memcached. In WordPress, get_posts (for instance) can utilize caching mechanisms regardless of whether they are initiated by AJAX. If a query result is cached, WordPress will retrieve it from the cache instead of querying the database again.
[ Please do not spam ]
Ok, can you clarify this sentence “WordPress has a built-in object cache that can be backed by Memcached”.
When you say “can” do you mean that it is not the standard operation of memcached within your plugin? So do I have to change something to make this happen?
It seems like the standard wordpress query cache is working without memcached with an ajax request but when memcached is switched on there is no caching, although I am determining this purely based on the timings supplied in the earlier post.
It is an option that needs to be enabled explicitly: first, in Site Tools -> Speed -> Caching -> Memcached. Then, the function needs to be enabled in the admin panel of WordPress -> Speed Optimizer -> Caching -> Memcached.
[ Please do not spam ]
Ok many thanks,
I confirm that with memcached switched on the admin ajax requests are taking almost twice as long to complete. I can see that it is almost impossible to determine the cause of this due to the lack of documentation available on this function.
I’ll leave it switched off for now.
Many thanks for your help.
In most cases, such issues are related to incompatibilities with plugins or themes in the site. You may want to test the queries with all other plugins disabled temporarily. Alternatively, you may also test other caching plugins which provide support for memcached. We are using a standard memcached implementation on our servers. Once you enable the service in the Site Tools, you will see the service port there. This allows you to use the information in the settings of any plugin with memcached support.
If you still experience issues, consider posting a support ticket through the Help Desk section of your User Area with SiteGround.
[ Please do not spam ]
On initial page load there is no problem. Memcached is working well. I have tested it with Query Monitor and Object Cache hits increase from about 70% (Memcached off) to 100% (Memcached on). I also think the initial page load is slightly quicker as per these values.
However, as discussed earlier, the major issue I’m having is that the subsequent ajax query which loads the posts and filters takes double the time with Memcached on. I can’t really see how a plugin or theme problem could cause this but I will continue trying to figure it out.
Thanks for your continued help. I will move onto the help desk if I cannot figure it out myself.
You are welcome, @confusedneedhelp . Without testing in on the site, we could only speculate on the source of the issue. The ticketing contact is the best option which would allow us to check and test the issue as it occurs.
[ Please do not spam ]
-
This reply was modified 5 months ago by
Plamen M.
Hi again,
The specific query I am looking at is returning around 6MB of data (nearly 4000 posts). I have read somewhere that memcached values are limited to 1MB. The smaller queries seem ok. So what I am thinking is that due to the size of this specific query it is not getting saved in Memcached and is therefore being requested by the database.
Then, when I turn memcached off, the query is able to access the WP query cache and return the results without using the database.
Could this be the issue? Is there a limit on the value size in memcached on your server?