Title: Memcached slows down query
Last modified: August 17, 2025

---

# Memcached slows down query

 *  Resolved [confusedneedhelp](https://wordpress.org/support/users/confusedneedhelp/)
 * (@confusedneedhelp)
 * [8 months ago](https://wordpress.org/support/topic/memcached-slows-down-query/)
 * Hi,
 * I have a site that has grown quite a lot over the years. I noticed some archive
   pages were loading slower than they used to which I put down to just having more
   posts. However, in doing some work on a staging site I noticed that it was faster
   than the production site. I worked it out that having memcached enabled is actually
   slowing my site down.
 * I am wondering if you might be able to offer any advice or things to check as
   to why this might be happening. It is still pretty quick either way but with 
   memcached set to off things are loading within a second and with it on it takes
   maybe a second or two more.
 * I was wondering if there was a limit for the memcache file and maybe it was hitting
   this limit and constantly refreshing itself?
 * Any help is appreciated.

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/memcached-slows-down-query/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/memcached-slows-down-query/page/2/?output_format=md)

 *  Thread Starter [confusedneedhelp](https://wordpress.org/support/users/confusedneedhelp/)
 * (@confusedneedhelp)
 * [8 months ago](https://wordpress.org/support/topic/memcached-slows-down-query/#post-18602448)
 * Just to add that with Memcached switched off in the plugin options it is still
   showing as active in phpinfo.
 *  Plugin Support [Simeon Boev](https://wordpress.org/support/users/k3llanved/)
 * (@k3llanved)
 * [8 months ago](https://wordpress.org/support/topic/memcached-slows-down-query/#post-18602708)
 * Hello [@confusedneedhelp](https://wordpress.org/support/users/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
 *  Thread Starter [confusedneedhelp](https://wordpress.org/support/users/confusedneedhelp/)
 * (@confusedneedhelp)
 * [8 months ago](https://wordpress.org/support/topic/memcached-slows-down-query/#post-18602907)
 * 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.
 *  Plugin Support [daniellaivanova](https://wordpress.org/support/users/daniellaivanova/)
 * (@daniellaivanova)
 * [8 months ago](https://wordpress.org/support/topic/memcached-slows-down-query/#post-18603043)
 * 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/](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
 *  Thread Starter [confusedneedhelp](https://wordpress.org/support/users/confusedneedhelp/)
 * (@confusedneedhelp)
 * [8 months ago](https://wordpress.org/support/topic/memcached-slows-down-query/#post-18603315)
 * 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.
 *  Plugin Support [daniellaivanova](https://wordpress.org/support/users/daniellaivanova/)
 * (@daniellaivanova)
 * [8 months ago](https://wordpress.org/support/topic/memcached-slows-down-query/#post-18603503)
 * 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
 *  Thread Starter [confusedneedhelp](https://wordpress.org/support/users/confusedneedhelp/)
 * (@confusedneedhelp)
 * [8 months ago](https://wordpress.org/support/topic/memcached-slows-down-query/#post-18603558)
 * 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?
 *  Plugin Support [Plamen M](https://wordpress.org/support/users/plamenm/)
 * (@plamenm)
 * [8 months ago](https://wordpress.org/support/topic/memcached-slows-down-query/#post-18603644)
 * Hello [@confusedneedhelp](https://wordpress.org/support/users/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 ]_
 *  Thread Starter [confusedneedhelp](https://wordpress.org/support/users/confusedneedhelp/)
 * (@confusedneedhelp)
 * [8 months ago](https://wordpress.org/support/topic/memcached-slows-down-query/#post-18603679)
 * 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.
 *  Plugin Support [Plamen M](https://wordpress.org/support/users/plamenm/)
 * (@plamenm)
 * [8 months ago](https://wordpress.org/support/topic/memcached-slows-down-query/#post-18603780)
 * 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 ]_
 *  Thread Starter [confusedneedhelp](https://wordpress.org/support/users/confusedneedhelp/)
 * (@confusedneedhelp)
 * [8 months ago](https://wordpress.org/support/topic/memcached-slows-down-query/#post-18603788)
 * 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.
 *  Plugin Support [Plamen M](https://wordpress.org/support/users/plamenm/)
 * (@plamenm)
 * [8 months ago](https://wordpress.org/support/topic/memcached-slows-down-query/#post-18603885)
 * 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 ]_
 *  Thread Starter [confusedneedhelp](https://wordpress.org/support/users/confusedneedhelp/)
 * (@confusedneedhelp)
 * [8 months ago](https://wordpress.org/support/topic/memcached-slows-down-query/#post-18603927)
 * 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.
 *  Plugin Support [Plamen M](https://wordpress.org/support/users/plamenm/)
 * (@plamenm)
 * [8 months ago](https://wordpress.org/support/topic/memcached-slows-down-query/#post-18604003)
 * You are welcome, [@confusedneedhelp](https://wordpress.org/support/users/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 8 months ago by [Plamen M](https://wordpress.org/support/users/plamenm/).
 *  Thread Starter [confusedneedhelp](https://wordpress.org/support/users/confusedneedhelp/)
 * (@confusedneedhelp)
 * [8 months ago](https://wordpress.org/support/topic/memcached-slows-down-query/#post-18604069)
 * 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?

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/memcached-slows-down-query/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/memcached-slows-down-query/page/2/?output_format=md)

The topic ‘Memcached slows down query’ is closed to new replies.

 * ![](https://ps.w.org/sg-cachepress/assets/icon-256x256.gif?rev=2971889)
 * [Speed Optimizer - The All-In-One Performance-Boosting Plugin](https://wordpress.org/plugins/sg-cachepress/)
 * [Support Threads](https://wordpress.org/support/plugin/sg-cachepress/)
 * [Active Topics](https://wordpress.org/support/plugin/sg-cachepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sg-cachepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sg-cachepress/reviews/)

## Tags

 * [ajax](https://wordpress.org/support/topic-tag/ajax/)

 * 17 replies
 * 4 participants
 * Last reply from: [confusedneedhelp](https://wordpress.org/support/users/confusedneedhelp/)
 * Last activity: [8 months ago](https://wordpress.org/support/topic/memcached-slows-down-query/page/2/#post-18604844)
 * Status: resolved