Separate DB connections for read and write #26909

Open
schnidrig opened this Issue Jan 9, 2017 · 3 comments

Projects

None yet

3 participants

@schnidrig
Contributor

Database:

Mariadb Galera cluster.
Maxscale: read/write spliter

ownCloud version:

8.1

Description

We at SWITCH and also some other NRENs noticed, that when using a galera
cluster, one also has to use an sql-proxy doing a read / write split.
Otherwise the db performance gets very, very bad due to some locking problems.

At SWITCH we use maxscale 1.3 for this. Unfortunately maxscale with
the read/write splitter is a terrible CPU hog.

But why should we operator have to retrofit OC with that feature?
Wouldn't it be much more efficient, if the code did use two connections.
One for write and a second one for read only db queries?

Then we could simply load balance the reads without having to inspect them.
This would save a awful lot of CPU cycles and as side effect also make OC a bit greener ;-)

@timm2k
timm2k commented Jan 10, 2017

I totally agree. We're using MaxScale 1.4. The CPU waste might be the same. MaxScale 2.0 might be better than 1.x but it comes with a new licensing.

My next step is to have a look at http://proxysql.com/. Percona does also prefer ProxySQL instead of MaxScale.

@PVince81
Collaborator

Are there other software using the same approach ? (just out of curiosity)

@DeepDiver1975 @butonic @PhilippSchaffrath

@schnidrig
Contributor

A mysql expert recently told me, that proxysql is not compatible with mariadb. I did not verify this statement tough.

There is a fork of maxscale: https://github.com/airbnb/maxscale
Didn't take a closer look at it yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment