MySQL cluster concurrency I have a little application that executes select queries against a MySQL cluster.

By using 1 thread to read a record the latency is x.

By using 2 threads to read records concurrently the avg latency is ~ 2x.

By using n threads to read records concurrently the avg latency is ~ nx.

Is there a way to optimize that?

I use one mysqld for 3 Data Nodes.
Make sure that you have uniform servers across the cluster because a slow/overloaded master node can affect performance of the Galera Replication cluster.
Check the node status by monitoring value of these variables wsrep_ready and wsrep_connected
Make sure that value of this variable is close to 0 wsrep_flow_control_paused
A high value for this variable wsrep_local_send_queue_avg for a node indicates a bottleneck in network line, If this is the case, the cause can be at any layer, from physical to OS configuration and must be investigated.
You can yourself profile SELECTs on diffrent nodes and see performance.



  mysql> SET profiling = 1;
  
  mysql> SELECT * FROM 
  
  mysql> SHOW PROFILES;


I hope this information helps.