haproxy vs maxscale

777 views
Skip to first unread message

Ramesh S

unread,
Oct 13, 2017, 9:02:34 AM10/13/17
to MaxScale

We have the below requirement, and we are using haproxy at the moment.

We have the 3-node Galera cluster setup. On all the three nodes haproxy is installed and configured. And we assigned one.floating ip With the floating ip, the application gets connected.

the reason behind installedhaproxy in all 3 servers is, when some server goes down, the haproxy started working from another server.

We would like to use maxscale instead of haproxy. Because haproxy used only for HA, and there is no load balancer happening. Means, when the application is hitting heavy, the reads/writes go for the only primary server, until and unless the server is down. That makes HA works.

We need to have the load-balancer.

Can we use insteadmaxscale of this? Will that help?

Markus Mäkelä

unread,
Oct 13, 2017, 9:08:27 AM10/13/17
to maxs...@googlegroups.com

Hi,

You should be able to use MaxScale as a replacement for haproxy. Using the readwritesplit routing module prevents certification conflicts that would happen with more simple load balancers as the readwritesplit routes all writes to one node but still load balances reads across all nodes.

If possible, it is usually recommended to have MaxScale on a separate server or on the application server. This way if a node failure happens, MaxScale can simply use another node without the application noticing it.

Markus

--
You received this message because you are subscribed to the Google Groups "MaxScale" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maxscale+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
Markus Mäkelä, Software Engineer
MariaDB Corporation
t: +358 40 7740484 | Skype: markus.j.makela 

Ramesh S

unread,
Oct 13, 2017, 10:57:24 AM10/13/17
to MaxScale
Thanks for the reply Markus.

From the email, I understood there is no need of installing the `maxscale` on `3-node galera cluster.` Would like to know, 

We have a setup of two application servers for failover.  In that case, we need to use/configure  `MaxScale`  on both servers to avoid load balance failures ?

Markus Mäkelä

unread,
Oct 13, 2017, 11:17:11 AM10/13/17
to maxs...@googlegroups.com

Hi,

Yes, that would be correct. One MaxScale on each application server should prevent all problems with failures. It will also give slightly better latency when compared to a MaxScale installed on a remote server.

Markus

Ramesh

unread,
Oct 13, 2017, 11:34:49 AM10/13/17
to Markus Mäkelä, maxs...@googlegroups.com
​Thanks for the email.

​The problem is we don't have the application server access.

We installed maxscale on all nodes [3-node galera cluster] with the apps pointing to the cluster using vip [ floating ip ].  We tested read/write with mysqlslap to make sure maxscale is doing fine or not.

We noticed, even when we do *inserts* [writes], it goes to primary server, as well as we could see the same number of threads created on other 2 nodes, but with *sleep* state..

  • Is this behaviour is normal ?
  • Is this the right approach to use maxscale ? 

To unsubscribe from this group and stop receiving emails from it, send an email to maxscale+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

-- 
Markus Mäkelä, Software Engineer
MariaDB Corporation
t: +358 40 7740484 | Skype: markus.j.makela 

--
You received this message because you are subscribed to a topic in the Google Groups "MaxScale" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/maxscale/baEYdJbIHDI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to maxscale+unsubscribe@googlegroups.com.

Markus Mäkelä

unread,
Oct 13, 2017, 12:58:50 PM10/13/17
to Ramesh, maxs...@googlegroups.com

Hi,


We noticed, even when we do *inserts* [writes], it goes to primary server, as well as we could see the same number of threads created on other 2 nodes, but with *sleep* state..

  • Is this behaviour is normal ?

Yes, this is expected. Each write is certified by the Galera cluster to prevent two transactions modifying the same row on two different nodes. This certification can create conflicts on COMMIT when multiple Galera nodes receive write traffic. To prevent this from becoming a problem, MaxScale routes all writes to only one node.

To my knowledge, Galera is not a solution for write scaling so there's no significant loss of performance in writing only to one one.

  • Is this the right approach to use maxscale ? 

Given your situation, this looks like a good solution. I suspect that there will be no large differences in neither performance nor functionality when compared to MaxScale's that are located on the application server.

Markus

Ramesh

unread,
Oct 14, 2017, 2:05:52 PM10/14/17
to Markus Mäkelä, maxs...@googlegroups.com
Thank you very much Markus, for your time and patience on replying questions.

--
Reply all
Reply to author
Forward
0 new messages