Question

I was wondering could I turn on the query_cache_type for mysql galera cluster of two nodes.

The scenario is : 1. Proxysql infront of two master-master galera(mysql) nodes 2. Inserts are coming through the proxysql 3. On the node2 I have a local PHP application, which is used for generating reports (many selects). There I would like to use the query cache. As far as I know query_cache should be disabled for galera cluster if you are using loadbalancing. At this particular case the selects are made directly on one of the nodes.

What is your opinion on the matter?

P.S. Or should I look for memcached instead....

Was it helpful?

Solution

No Query Cache on Galera Cluster. It is much to complex to keep it in sync among the nodes.

Instead, depend on the buffer_pool, etc, to make the queries "fast enough".

In 95+% of Production systems, the Query Cache (or any other caching) is a waste. Why? Because data is flowing in so fast that the cache must be all-too-frequently purged.

Perhaps your application is mostly read-only? That might be a justification for a read cache.

Perhaps your read queries are so slow that you have turned to caching as a 'fix'. Instead, let's look at the queries. Often, there is a simple solution (such as a composite index) to speed up reads to the point where caching is unnecessary.

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top