-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathproxysql.cnf
76 lines (67 loc) · 2.58 KB
/
proxysql.cnf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
datadir="/var/lib/proxysql"
errorlog="/var/lib/proxysql/proxysql.log"
admin_variables=
{
admin_credentials="root:root"
mysql_ifaces="0.0.0.0:6032"
}
mysql_servers =
(
{ address="mariadb", port=3306, hostgroup=1, max_connections=650 },
{ address="mariadb", port=3306, hostgroup=2, max_connections=150 },
{ address="mariadb", port=3306, hostgroup=3, max_connections=150 },
{ address="mariadb", port=3306, hostgroup=4, max_connections=50 },
)
mysql_users =
(
{ username="root", password="root", default_hostgroup=1 },
{ username="root", password="root", default_hostgroup=2 },
{ username="root", password="root", default_hostgroup=3 },
{ username="root", password="root", default_hostgroup=4 },
)
mysql_variables=
{
threads=4
mysql-auditlog_filename="mysql.log"
max_connections=2048
default_query_delay=0
default_query_timeout=36000000
have_compress=false
poll_timeout=2000
mysql-autocommit_false_is_transaction=true
interfaces="0.0.0.0:6033"
default_schema="information_schema"
stacksize=1048576
server_version="8.0.0"
mysql-forward_autocommit=true
connect_timeout_server=3000
monitor_username="root"
monitor_password="root"
monitor_history=600000
monitor_connect_interval=60000
monitor_ping_interval=10000
monitor_read_only_interval=1500
monitor_read_only_timeout=500
ping_interval_server_msec=120000
ping_timeout_server=500
commands_stats=true
sessions_sort=true
connect_retries_on_failure=10
}
# Query Rules and Routing
mysql_query_rules=(
{ rule_id=1, active=1, match_pattern="SELECT", destination_hostgroup=1 },
{ rule_id=2, active=1, match_pattern="UPDATE", destination_hostgroup=2 },
{ rule_id=3, active=1, match_pattern="INSERT", destination_hostgroup=3 },
{ rule_id=4, active=1, match_pattern="DELETE", destination_hostgroup=4 },
)
# Connection Pooling Settings
mysql-max_connections=1000 # Maximum number of connections ProxySQL will maintain.
mysql-server_max_connections=1000 # Maximum number of connections a backend MySQL server can accept.
mysql-connections_max_memory=10000000 # Maximum memory used by the connection pool. units of bytes
# In this example, connections_max_memory is set to 10,000,000 bytes, which is approximately 10 megabytes.
# Connection Retries
mysql-connect_retries=3 # Number of times ProxySQL should attempt to connect to a backend MySQL server before marking it as offline.
mysql-connect_timeout_server=200 # Time ProxySQL will wait before retrying a connection.
# Load Balancing
mysql-weight=1000 # Customize load balancing algorithms.