MySQL Forums
Forum List  »  Router & Proxy

Newbie questions
Posted by: Charles White
Date: January 04, 2008 01:33PM

I am trying to use MySQL Proxy for load balancing and failover and I am having limited success. I am not sure if it is my lack of understanding or if the problem I am having is a "feature" of MySQL Proxy.
First let me describe the environment that I am working with. I have replication set up with a single master database and n readonly slaves. My application has two connections to the databases, one for read and one for write. The majority of the application only reads data and gets data from a readonly slaves. When we write to the database our application uses a write connection for the write, and subsequent reads for the duration of the session. The reason that we continue to use the write database for reading is make sure the user does not have to deal with inconsistent data due to replication delays.

I have set up MySQL Proxy to round robin the readonly databases with multiple proxy-backend-addresses. When connections are made, the round robin seems to be working fine. When a server fails, the next connection via the proxy connects to the next available server. However, when a query is made to an existing connection on the now defunct server, I get an error back from the proxy. Subsequent queries via this connection are redirected to the next available server in the round robin. It seems to me that the proxy server should have captured the initial failure, and seamlessly connect me to the next available server, leaving my application unaware of the switch. The way that it currently works, I will need to code re-try logic on connection failure.
(finally the question)
Is this the way that it is supposed to work or is there a config option that I am missing?

Also, why I am asking questions, I believe that it would be pretty easy to redirect data modifications to the master database, is there an obvious way to redirect subsequent reads?

Thanks,

Options: ReplyQuote


Subject
Views
Written By
Posted
Newbie questions
2963
January 04, 2008 01:33PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.