colinmollenhour / mariadb-galera-swarm

MariaDb Galera Cluster container based on official mariadb image which can auto-bootstrap and recover cluster state.
https://hub.docker.com/r/colinmollenhour/mariadb-galera-swarm
Apache License 2.0
223 stars 102 forks source link

Slow inserts - normal on gallera? #114

Closed CoWayger closed 11 months ago

CoWayger commented 11 months ago

Hi, I'm having issues running default config in swarm.

I have dual 2.5Gbit nics + NVME drives. Yet insert performance is around 100 rows/s. In standalone config, it is 3000+ rows/s. What could be wrong? Is this drop expected for gallera deployments?

colinmollenhour commented 11 months ago

The expected performance hit is that each commit is delayed by the latency between the nodes, so if you have 5ms latency that is 5ms of additional time per commit. So if your inserts are serialized then perhaps that can explain your degradation. You could try running multiple insert transactions in parallel or combining them into multiple inserts per commit or multiple inserts per statement to get better performance.

Please note this is not a great place for Galera support, I do not consider myself a Galera expert and do not wish to engage in general community support, a place like Stack Exchange is more appropriate for this type of question.