# Waiting on query cache mutex

**URL:** <https://forums.percona.com/t/waiting-on-query-cache-mutex/1646>\
**Category:** Other MySQL® Questions\
**Created:** [August 12, 2011, 3:13am UTC](https://forums.percona.com/t/waiting-on-query-cache-mutex/1646 "2011-08-12T03:13:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![grim8634](https://avatars.discourse-cdn.com/v4/letter/g/6a8cbe/32.png) [@grim8634](https://forums.percona.com/u/grim8634)\
**Post date:** [August 12, 2011, 3:13am UTC](https://forums.percona.com/t/waiting-on-query-cache-mutex/1646/1 "2011-08-12T03:13:07Z")

</div>

Hi All

I’m seeing a lot of “Waiting on query cache mutex” threads when I’m running a lot of small updates on a particular table (InnoDB).

When this happens all the DBs on the server basically grind to a halt. I’ve disabled the query cache on the server entirely for the time being and this prevents them from completely grinding to a halt when the update is running, but has had a significant impact on query response times the rest of the time.

Is it feasible to disable the query cache whilst running the updates and re-enable as soon a it’s completed or is there some alternate solution?

Thanks a lot 🙂

---

<div class="post-metadata">

**Author:** ![gmouse](https://avatars.discourse-cdn.com/v4/letter/g/b9e5f3/32.png) [@gmouse](https://forums.percona.com/u/gmouse)\
**Post date:** [August 12, 2011, 4:15am UTC](https://forums.percona.com/t/waiting-on-query-cache-mutex/1646/2 "2011-08-12T04:15:25Z")

</div>

You could try it:  
SET GLOBAL query\_cache\_size = 0;  
and after your updates, change it back to its default value. But you will face the ‘significant impact’ during your update queries, especially during the updates when your server is doing extra work. Maybe it is possible to implement caching in your application.

---

<div class="post-metadata">

**Author:** ![grim8634](https://avatars.discourse-cdn.com/v4/letter/g/6a8cbe/32.png) [@grim8634](https://forums.percona.com/u/grim8634)\
**Post date:** [August 12, 2011, 4:40am UTC](https://forums.percona.com/t/waiting-on-query-cache-mutex/1646/3 "2011-08-12T04:40:00Z")

</div>

I’ve just spotted that the query cache was set far too big (2Gb), I think reducing it will probably alleviate the problem. And yes I’d love to implement application layer caching, but this is something we’ve inherited and could do with a quicker solution for the short term. Thanks for your help.
