One of my PHP apps does not properly use transactions to group queries/updates together so each query/update is auto-committed for a given web page. The PHP app does open the connection to MySQL requesting persistent connections.If I use ProxySQL between the PHP app and MySQL to a hostgroup of 2 equally weighted backend servers for load balancing, is there a possibility that the 10 or so queries/updates that the PHP app does on a single connection are load balanced and might end up on different MySQL backends? The backends will be using Master/Master replication, but the updates of the other backend may be delayed due to replication lag.
That is, does ProxySQL load balance connections with all queries/updates done with a single connection go to the same backend (like HAProxy does with stick tables to remember the backend server selected for the session)?
--
You received this message because you are subscribed to the Google Groups "proxysql" group.
To unsubscribe from this group and stop receiving emails from it, send an email to proxysql+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Unrelated: master/master replication is quite scary, and I strongly recommend to use only 1 node for writes.
Yes, by default, it is possible that the requests coming from a single connection are evenly distributed among all the backends of the same hostgroup.
Kevin,
To unsubscribe from this group and stop receiving emails from it, send an email to proxysql+u...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to proxysql+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to proxysql+unsubscribe@googlegroups.com.
Sounds like you want persistent connection.
To unsubscribe from this group and stop receiving emails from it, send an email to proxysql+unsubscribe@googlegroups.com.
Queues is still implemented setting max_connections for a backend.hmm, choosing always the same backend is incompatible with ProxySQL design, as all the backends within an hostgroup are to be considered equivalents.Yet, the current design allows to isolate (make it sticky) a single connection, so temporary disabling multiplexing on it should suffice.
[root@6db9cf678ff5 ~]# mysql -u shahril -pDBaaS1234% -h 172.17.0.2 -e "select @@hostname; "mysql: [Warning] Using a password on the command line interface can be insecure.+--------------+| @@hostname |+--------------+| 6db9cf678ff5 |+--------------+[root@6db9cf678ff5 ~]# mysql -u shahril -pDBaaS1234% -h 172.17.0.2 -e "select @@hostname; "mysql: [Warning] Using a password on the command line interface can be insecure.+--------------+| @@hostname |+--------------+| b7775bce7cea |+--------------+[root@6db9cf678ff5 ~]# mysql -u shahril -pDBaaS1234% -h 172.17.0.2 -e "select @@hostname; "mysql: [Warning] Using a password on the command line interface can be insecure.+--------------+| @@hostname |+--------------+| 6db9cf678ff5 |+--------------+[root@6db9cf678ff5 ~]# mysql -u shahril -pDBaaS1234% -h 172.17.0.2 -e "select @@hostname; "mysql: [Warning] Using a password on the command line interface can be insecure.+--------------+| @@hostname |+--------------+| 6db9cf678ff5 |+--------------+
MySQL [(none)]> select username, fast_forward, transaction_persistent, max_connections from mysql_users where username = 'shahril';+----------+--------------+------------------------+-----------------+| username | fast_forward | transaction_persistent | max_connections |+----------+--------------+------------------------+-----------------+| shahril | 1 | 1 | 2000 |+----------+--------------+------------------------+-----------------+1 rows in set (0.00 sec)MySQL [(none)]> select * from global_variables where variable_name like '%multipl%';+-------------------------------------+----------------+| variable_name | variable_value |+-------------------------------------+----------------+| mysql-connection_delay_multiplex_ms | 0 || mysql-multiplexing | false |+-------------------------------------+----------------+2 rows in set (0.00 sec)
To unsubscribe from this group and stop receiving emails from it, send an email to proxysql+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to proxysql+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to proxysql+unsubscribe@googlegroups.com.
Hi Shahril,
My interpretation of the above is that you don't need sticky connections, but "source IP hash" load balancing algorithm.ProxySQL doesn't support it (yet?), but can do routing based on client address (IP) using rules in mysql_query_rules. You will need to hardcode each web server IP to a hostgroup with just one DB server.I am not sure what is your need for this, but I would like to hear more about it.