Uploaded image for project: 'MariaDB MaxScale'
  1. MariaDB MaxScale
  2. MXS-2679

Galera router with write load balancing

Details

    • New Feature
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Won't Do
    • None
    • N/A
    • N/A

    Description

      Currently, on Galera clusters the most commonly used router is read-write split, which only sends the writes to one of the nodes. One of the advantages of Galera is the full write support on all nodes, so it would be very useful to have a router which could route the write requests to all nodes.

      One way to do this would be to open a connection to only one of the Galera nodes for each incoming session; then all traffic from this session goes to the chosen node. The choice of the node could be a simple round-robin, or, optionally, a some more advanced algorithm based on the number of open sessions to each node.

      Attachments

        Activity

          markus makela markus makela added a comment - - edited

          This has proven to be a misconception among users: our research suggests that writing to multiple Galera nodes does not increase the scalability of writes and only leads to deadlock errors on commit.

          This configuration is possible right now with the readconnroute router with the router_options parameter set to synced but we don't recommend it due to the changes that are required to the application logic.

          markus makela markus makela added a comment - - edited This has proven to be a misconception among users: our research suggests that writing to multiple Galera nodes does not increase the scalability of writes and only leads to deadlock errors on commit. This configuration is possible right now with the readconnroute router with the router_options parameter set to synced but we don't recommend it due to the changes that are required to the application logic.

          Thanks for the hint, Markus, very helpful.

          As of the misconception, I now feel a happily misconcepted Galera user since I've been dong for years exactly this in a multi-app, multi-db environment - using HAProxy It is good to know that MaxScale can do it too.

          In fact, it could be made even better as in the above scenario it is best when each client is routed to only one of the nodes, so clients are distributed among the nodes based on which DB they what to access. This helps avoid deadlocks and nicely scales the write capability of the cluster while providing transparent failover in case a node goes down. What I describe is also doable with HAProxy and works nicely - so would be cool to have this in MaxScale too some day.

          You may close the ticket at your discretion.

          assen.totin Assen Totin (Inactive) added a comment - Thanks for the hint, Markus, very helpful. As of the misconception, I now feel a happily misconcepted Galera user since I've been dong for years exactly this in a multi-app, multi-db environment - using HAProxy It is good to know that MaxScale can do it too. In fact, it could be made even better as in the above scenario it is best when each client is routed to only one of the nodes, so clients are distributed among the nodes based on which DB they what to access. This helps avoid deadlocks and nicely scales the write capability of the cluster while providing transparent failover in case a node goes down. What I describe is also doable with HAProxy and works nicely - so would be cool to have this in MaxScale too some day. You may close the ticket at your discretion.
          markus makela markus makela added a comment -

          Splitting the load according to the database does prevent deadlocks but I don't think it improves write scalability as the same amount of IO is done on all nodes. I defer to the Galera experts on this but to my recollection, there's no throughput benefit to writing to multiple Galera nodes at the same time.

          markus makela markus makela added a comment - Splitting the load according to the database does prevent deadlocks but I don't think it improves write scalability as the same amount of IO is done on all nodes. I defer to the Galera experts on this but to my recollection, there's no throughput benefit to writing to multiple Galera nodes at the same time.
          anthosz Anthony added a comment -

          Hello,

          @markus, it doesn't works on my side. All requests are always forwarded to slaves instead to both.

          I have a listener for RW and a service related:
          [server-Service]
          type=service
          router=readconnroute
          router_options=synced
          servers=server-01,server-02,server-03

          After restart -> All requests are redirected only to the slaves (read/write).

          I also tried with router_options=master,slave and it's the same.

          Also for router_options=running.

          server protocol: MySQLBackend
          listener protocol: MySQLClient
          With 3 backends: Percona XtraDB Cluster 5.7

          I want to use MaxScale only like LB in a first time (read/write) but it seems that we can only split read/write between master & slave :o

          Best regards,

          anthosz Anthony added a comment - Hello, @markus, it doesn't works on my side. All requests are always forwarded to slaves instead to both. I have a listener for RW and a service related: [server-Service] type=service router=readconnroute router_options=synced servers=server-01,server-02,server-03 After restart -> All requests are redirected only to the slaves (read/write). I also tried with router_options=master,slave and it's the same. Also for router_options=running. server protocol: MySQLBackend listener protocol: MySQLClient With 3 backends: Percona XtraDB Cluster 5.7 I want to use MaxScale only like LB in a first time (read/write) but it seems that we can only split read/write between master & slave :o Best regards,
          markus makela markus makela added a comment -

          anthosz this seems to be a separate issue, please file a new bug report for it.

          markus makela markus makela added a comment - anthosz this seems to be a separate issue, please file a new bug report for it.

          People

            toddstoffel Todd Stoffel (Inactive)
            assen.totin Assen Totin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.