Galera query_cache_size

Hi all,

what will happen if we still to set query_cache_size >0 (everywhere query_cache_size =0 is viewed as mandatory) ?

Sergey

Hi.

It depends on your load balancing method, I think.

cashing may be done within each node, so If you don’t balance read traffic with session persitency(ex. simple round robin),
cost to create cash may increase and cash hit rate would be down.

Please also be aware that there is read consistency(wsrep_causal_reads) problem.

Hmm,

so if I’m using a couple of additional nodes only for backup
(I mean that I use Galera with 3 nodes - 1 for all transactions, 2 for replications)

  • I will have no bad situation and I can safely use cache ?
    Despite of requirements of official documents/sites…

thank you for reply.

this is my opinion.

Performance Issue

  • additional cost for update, insert, delete query (cache update cost for all the node is needed).
  • cost for select query is needed only on executed node.
    (but if your query is executed to the other node, there would be no caching, so cache hit rate would be worse)
    (* galera cluster is well suited for balancing read traffic)

this is the same as mysql cluster (p.40)
[url]http://www.slideshare.net/matkeep/mysql-cluster-performance-best-practices[/url]

so query cache effect would be much worse than single node, eventual performance would be worse for most of the cases.

Consistency Issue(use safety)

  • safe or not is deeply related to read consistency issue.