ProxySQL is a powerful software load balancer and an open-source database protocol-aware proxy for MySQL that provides high performance, high availability, and high availability.
Typically, a load balancer distributes network or application traffic among available servers, resulting in increased application efficiency, dependability, availability, and performance by boosting concurrent users and enhancing hardware utilization efficiency.
ProxySQL is a daemon that is monitored by a monitoring process. To reduce downtime, the process monitors the daemon and restarts it if it crashes. The daemon accepts traffic from MySQL clients and routes it to MySQL servers in the backend.
UPDATING MySQL SERVER VALUES in ProxySQL
All backend servers that are either MySQL servers or use the MySQL Protocol such as another ProxySQL instance are listed in the table mysql servers.
Hostgroups are collections of servers with the same logical functioning that are used to organize servers into groups.
INSERT INTO mysql_servers (
hostgroup_id, hostname, port, max_connections ) VALUES
(2, ‘reportingInstance’,3306,0,1000);UPDATE mysql_servers SET max_connections = 2000
WHERE hostname = ‘reportingInstance’;DELETE FROM mysql_servers
WHERE hostname = ‘reportingInstance’;
After adding the configuration, we must load the configuration into runtime and store it on disk. Otherwise, the configurations would be lost when the ProxySQL is restarted. So, in order to load the configuration into memory and save it to disk, the following commands are required.
# Active current in-memory MySQL User Configuration
LOAD MYSQL SERVERS TO RUNTIME;# Save the current in-memory MySQL User configuration to the disk
SAVE MYSQL SERVERS TO DISK;
Hope you find this article helpful.