Invalidating cache php

You can access the patch from: 2768 Kristofer Pettersson 2008-10-09 Bug#38551 query cache can still consume [very little] cpu time even when it is off.

By checking query_cache_size before attempting to invalidate a table or db we avoid grabbing the query cache mutex.

A graceful restart (sending SIGHUP to it) is enough for the cache to clear.

According to a guy in the #php channel on freenode, this is the recommended way to do it.

How to repeat: Run a sysbench read-write benchmark with lots of threads.

Measure the time spent in Query Cache::invalidate()A patch for this bug has been committed.

At this time there is no plan to backport the fix to a stable release as it changes the behavior of the query_cache_type command line option.

Also, if query cache is not used at all, one can build (or request a build) with query cache disabled (see --without-query-cache).

By using the command line option --query_cache_type=0, the user can disable the query cache permanently and avoid taking the query cache mutex. After review, it may be pushed to the relevant source trees for release in the next version.

You can access the patch from: 2742 Kristofer Pettersson 2008-10-27 Bug#38551 query cache can still consume [very little] cpu time even when it is off.

By using the command line option --query_cache_type=0, the user can disable the query cache permanently and avoid taking the query cache mutex. After review, it may be pushed to the relevant source trees for release in the next version. After review, it may be pushed to the relevant source trees for release in the next version.

What this means is that you cannot clear the cache from the CLI, because running a script from the CLI will launch a new process.

There are two solutions that I know of, and I'm not satisfied with either of them: Restarting the FPM will involve tinkering with sudoers a bit, since you need to give your regular users the ability to restart it.

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “invalidating cache php”