MySQL Variables

List of MySQL Variables

NOTE: You can click on the variable name to jump to its definition

Variable name Default Value
mysql-add_ldap_user_comment
mysql-auditlog_filename
mysql-auditlog_filesize 100MB
mysql-auto_increment_delay_multiplex 5
mysql-autocommit_false_is_transaction false
mysql-autocommit_false_not_reusable false
mysql-binlog_reader_connect_retry_msec 3000
mysql-client_found_rows true
mysql-client_multi_statements true
mysql-client_session_track_gtid true
mysql-commands_stats true
mysql-connect_retries_delay 1
mysql-connect_retries_on_failure 10
mysql-connect_timeout_server 3000
mysql-connect_timeout_server_max 10000
mysql-connection_delay_multiplex_ms 0
mysql-connection_max_age_ms 0
mysql-connpoll_reset_queue_length 50
mysql-default_character_set_results NULL
mysql-default_charset utf8
mysql-default_collation_connection
mysql-default_isolation_level READ COMMITTED
mysql-default_max_join_size 18446744073709551615
mysql-default_max_latency_ms 1000
mysql-default_net_write_timeout 60
mysql-default_query_delay 0
mysql-default_query_timeout 36000000
mysql-default_reconnect true
mysql-default_schema information_schema
mysql-default_session_track_gtids OFF
mysql-default_sql_auto_is_null OFF
mysql-default_sql_mode
mysql-default_sql_safe_updates OFF
mysql-default_sql_select_limit DEFAULT
mysql-default_time_zone SYSTEM
mysql-default_transaction_read WRITE
mysql-default_tx_isolation READ-COMMITTED
mysql-enforce_autocommit_on_reads false
mysql-eventslog_default_log 0
mysql-eventslog_filename
mysql-eventslog_filesize 104857600
mysql-eventslog_format 1
mysql-forward_autocommit false
mysql-free_connections_pct 10
mysql-have_compress true
mysql-have_ssl false
mysql-hostgroup_manager_verbose 1
mysql-init_connect
mysql-interfaces 0.0.0.0:6033
mysql-keep_multiplexing_variables tx_isolation,version
mysql-kill_backend_connection_when_disconnect true
mysql-ldap_user_variable
mysql-log_mysql_warnings_enabled false
mysql-log_unhealthy_connections true
mysql-long_query_time 1000
mysql-max_allowed_packet 4194304
mysql-max_connections 2048
mysql-max_stmts_cache 10000
mysql-max_stmts_per_connection 20
mysql-max_transaction_time 14400000
mysql-min_num_servers_lantency_awareness 1000
mysql-mirror_max_concurrency 16
mysql-mirror_max_queue_length 32000
mysql-multiplexing true
mysql-ping_interval_server_msec 120000
mysql-ping_timeout_server 500
mysql-poll_timeout 2000
mysql-poll_timeout_on_failure 100
mysql-query_cache_size_MB 256
mysql-query_cache_stores_empty_result true
mysql-query_digests true
mysql-query_digests_grouping_limit 3
mysql-query_digests_lowercase false
mysql-query_digests_max_digest_length 2048
mysql-query_digests_max_query_length 65000
mysql-query_digests_no_digits false
mysql-query_digests_normalize_digest_text false
mysql-query_digests_replace_null false
mysql-query_digests_track_hostname false
mysql-query_processor_iterations 0
mysql-query_processor_regex 1
mysql-query_retries_on_failure 1
mysql-reset_connection_algorithm 2
mysql-server_capabilities 569867
mysql-server_version 5.5.30
mysql-servers_stats true
mysql-session_idle_ms 1000
mysql-session_idle_show_processlist true
mysql-sessions_sort true
mysql-set_query_lock_on_hostgroup 1
mysql-show_processlist_extended 0
mysql-shun_on_failures 5
mysql-shun_recovery_time_sec 10
mysql-ssl_p2s_ca
mysql-ssl_p2s_cert
mysql-ssl_p2s_cipher
mysql-ssl_p2s_key
mysql-stacksize 1048576
mysql-stats_time_backend_query false
mysql-stats_time_query_processor false
mysql-tcp_keepalive_time 0
mysql-threads 4
mysql-threshold_query_length 524288
mysql-threshold_resultset_size 4194304
mysql-throttle_connections_per_sec_to_hostgroup 1000000
mysql-throttle_max_bytes_per_second_to_client 0
mysql-throttle_ratio_server_to_client 0
mysql-use_tcp_keepalive 0
mysql-verbose_query_error false
mysql-wait_timeout 28800000

mysql-add_ldap_user_comment

If mysql-add_ldap_user_comment is set, a comment like the following will be added on the query::

valueof_mysql-add_ldap_user_comment=frontend_username 
MySQL Variable Name mysql-add_ldap_user_comment
Dynamic Yes
Permitted Values Type String
Default NULL
Valid values

mysql-ldap_user_variable

When set, sessions will have a variable set with the user_name value, ie: SET @mysql-ldap_user_variable:='username'
The use of this variable can be for auditing purposed backend side. For example, if a trigger on a table will use that session variable.

MySQL Variable Name mysql-ldap_user_variable
Dynamic Yes
Permitted Values Type String
Default NULL
Valid values

mysql-auditlog_filename

This variable defines the base name of the audit log where audit events are logged. The filename of the log file will be the base name followed by an 8 digits progressive number.

MySQL Variable Name mysql-auditlog_filename
Dynamic Yes
Permitted Values Type String
Default NULL
Valid values

mysql-auditlog_filesize

This variable defines the maximum file size of the audit log when the current file will be closed and a new file will be created.
The default value is 104857600 (100MB)

System Variable Name mysql-auditlog_filesize
Dynamic Yes
Permitted Values Type Integer (count)
Default 104857600
Minimum 1MB
Maximum 1GB

mysql-auto_increment_delay_multiplex

Several applications rely, explicitly or implicitly, on the value returned by LAST_INSERT_ID(). If multiplexing is not configured correctly, or if the queries pattern is really unpredictable (for example if new queries are often deployed), it is possible that the query using LAST_INSERT_ID() uses a connection different than the connection where an auto-increment was used.
If mysql-auto_increment_delay_multiplex is set, after an OK packet with last_insert_id is received, multiplexing is temporarily disabled for the same number of queries as specified in mysql-auto_increment_delay_multiplex.
Note that disabling multiplexing doesn’t disable routing, so it is important to configure read/write split correctly.

System Variable Name mysql-auto_increment_delay_multiplex
Dynamic Yes
Permitted Values Type Integer (count)
Default 5
Minimum 0
Maximum 1000000

mysql-autocommit_false_is_transaction

If mysql-autocommit_false_is_transaction=true (false by default), a connection with autocommit=0 is treated as a transaction. If forward_autocommit=true (false by default), the same behavior applies.

System Variable Name mysql-autocommit_false_is_transaction
Dynamic Yes
Permitted Values Type Boolean
Default false

mysql-autocommit_false_not_reusable

When set to true, a connection with autocommit=0 is not re-used and is destroyed when the connection is returned to the connection pool.

System Variable Name mysql-autocommit_false_not_reusable
Dynamic Yes
Permitted Values Type Boolean
Default false

mysql-binlog_reader_connect_retry_msec

Controls the connect retry timeout for the binlog reader (introduced in ProxySQL 2.0).

System Variable Name mysql-binlog_reader_connect_retry_msec
Dynamic Yes
Permitted Values Type Integer (milliseconds)
Default 3000
Minimum 200
Maximum 120000

mysql-client_found_rows

When set to true, client flag CLIENT_FOUND_ROWS is set when connecting to MySQL backends.

System Variable Name mysql-client_found_rows
Dynamic Yes
Permitted Values Type Boolean
Default true

mysql-client_multi_statements

When set to true, client flag CLIENT_MULTI_STATEMENTS is set when connecting to MySQL backends.

System Variable Name mysql-client_multi_statements
Dynamic Yes
Permitted Values Type Boolean
Default true

mysql-client_session_track_gtid

When activated ProxySQL will keep track of the GTID status on the backend serves in the stats_mysql_gtid_executed table.

System Variable Name mysql-client_session_track_gtid
Dynamic Yes
Permitted Values Type Boolean
Default true

mysql-commands_stats

Enable per-command MySQL query statistics. A command is a type of SQL query that is being executed. Some examples are: SELECT, INSERT or ALTER TABLE.

System Variable Name mysql-commands_stats
Dynamic Yes
Permitted Values Type Boolean
Default true

mysql-connect_retries_delay

The delay (in milliseconds) before trying to reconnect after a failed attempt to a backend MySQL server. Failed attempts can take place due to numerous reasons: too busy, timed out for the current attempt, etc. This will be retried for mysql-connect_retries_on_failure times.

System Variable Name mysql-connect_retries_delay
Dynamic Yes
Permitted Values Type Integer (milliseconds)
Default 1
Minimum 0
Maximum 10000

mysql-connect_retries_on_failure

The number of times for which a reconnect should be attempted in case of an error, timeout, or any other event that led to an unsuccessful connection to a backend MySQL server. After the number of attempts is depleted, if a connection still couldn’t be established, an error is returned. The error returned is either the last connection attempt error or a generic error (“Max connect failure while reaching hostgroup” with error code 28000).

Be careful about tweaking this parameter – a value that is too high can significantly increase the latency with which an unresponsive hostgroup is reported to the MySQL client.

System Variable Name mysql-connect_retries_on_failure
Dynamic Yes
Permitted Values Type Integer
Default 10
Minimum 0
Maximum 1000

mysql-connect_timeout_server

The timeout for a single attempt at connecting to a backend server from the proxy. If this fails, according to the other parameters, the attempt will be retried until too many errors per second are generated (and the server is automatically shunned) or until the final cut-off is reached and an error is returned to the client (see mysql-connect_timeout_server_max).

System Variable Name mysql-connect_timeout_server
Dynamic Yes
Permitted Values Type Integer (milliseconds)
Default 1000
Minimum 10
Maximum 120000

mysql-connect_timeout_server_max

The timeout for connecting to a backend server from the proxy. When this timeout is reached, an error is returned to the client with code 9001 and the message “Max connect timeout reached while reaching hostgroup…”.

See also mysql-shun_recovery_time_sec

System Variable Name mysql-connect_timeout_server_max
Dynamic Yes
Permitted Values Type Integer (milliseconds)
Default 10000
Minimum 10
Maximum 3600000

Due to a bug fixed in version 2.0.7, for all previous releases it is recommended to not set this value higher than 10 minutes.

mysql-connection_delay_multiplex_ms

Disable multiplexing for a short period of time on a connection, this will allow a frontend connection to re-use the same backend connection for successive queries (e.g. when batching queries). The delay is measured for the time there is no activity on the connection.

System Variable Name mysql-connection_delay_multiplex_ms
Dynamic Yes
Permitted Values Type Integer (milliseconds)
Default 0
Minimum 0
Maximum 300000

mysql-connection_max_age_ms

When mysql-connection_max_age_ms is set to a value greater than 0, inactive connections in the connection pool (therefore not currently used by any session) are closed if they were created more than mysql-connection_max_age_ms milliseconds ago. By default, connections aren’t closed based on their age.
When mysql-connection_max_age_ms is reached, connections are simply disconnected, without sending COM_QUIT command to the server, so this might result in ‘Aborted connection’ warnings showing up in your MySQL server logs (this behaviour is intended, see #1861).

System Variable Name mysql-connection_max_age_ms
Dynamic Yes
Permitted Values Type Integer (milliseconds)
Default 0
Minimum 0
Maximum 86400000

mysql-connpoll_reset_queue_length

PoxySQL 1.4.0 introduced a background thread (HGCU_thread_run()) responsible for resetting connections instead of dropping them when MySQL_HostGroups_Manager::destroy_MyConn_from_pool() is called. There could be cases in which this behavior is not beneficial. In ProxySQL 1.4.4 mysql-connpoll_reset_queue_length allows this behavior to be configurable by destroying the connection when the defined threshold is reached.

System Variable Name mysql-connpoll_reset_queue_length
Dynamic Yes
Permitted Values Type Integer
Default 50
Minimum 0
Maximum 1000

mysql-default_charset

The default server charset to be used in the communication with the MySQL clients. Note that this is the default for client connections, not for backend connections.

Values for mysql-default_charset and mysql-default_collation_connection must be compatible to each other. If they are not, ProxySQL will configure mysql-default_charset using the charset of collation mysql-default_collation_connection.

System Variable Name mysql-default_charset
Dynamic Yes
Permitted Values Type String
Default utf8
Valid Values Run “select * from mysql_collations;” in the Admin interface to view the full list

mysql-default_character_set_results

Deprecated in version 2.0.11. See mysql-default_variables

The character set used for returning query results to the client. This includes result data such as column values, result metadata such as column names, and error messages.

System Variable Name mysql-default_character_set_results
Dynamic Yes
Permitted Values Type String
Default NULL
Valid Values

mysql-default_collation_connection

The default server collation to be used in the communication with the MySQL clients. Note that this is the default for client connections, not for backend connections.

Values for mysql-default_charset and mysql-default_collation_connection must be compatible to each other. If they are not, ProxySQL will configure mysql-default_charset using the charset of collation mysql-default_collation_connection.

System Variable Name mysql-default_collation_connection
Dynamic Yes
Permitted Values Type String
Default NULL
Valid Values

mysql-default_isolation_level

Deprecated in version 2.0.11. See mysql-default_variables

The default transaction isolation level.
Very important: SESSION is mandatory, SET TRANSACTION ISOLATION LEVEL value is not supported and will disable multiplexing

mysql-default_isolation_level Name mysql-default_collation_connection
Dynamic Yes
Permitted Values Type String
Default READ COMMITTED
Valid Values ONLY at SESSION level: REPEATBALE READ, READ COMMITTED, SERIALIZED

mysql-default_max_join_size

Deprecated in version 2.0.11. See mysql-default_variables

Do not permit statements that probably need to examine more than max_join_size rows (for single-table statements) or row combinations (for multiple-table statements) or that are likely to do more than max_join_size disk seeks. By setting this value, you can catch statements where keys are not used properly and that would probably take a long time.
Set it if your users tend to perform joins that lack a WHERE clause, that take a long time, or that return millions of rows. Default: 18446744073709551615

System Variable Name mysql-default_max_join_size
Dynamic Yes
Permitted Values Type Integer (milliseconds)
Default 18446744073709551615
Minimum 0
Maximum 18446744073709551615

mysql-default_max_latency_ms

ProxySQL uses a mechanism to automatically ignore hosts if their latency is excessive. Note that hosts are not disabled, but only ignored: in other words, ProxySQL will prefer hosts with a smaller latency. It is possible to configure the maximum latency for each backend from mysql_servers table, column max_latency_ms. If mysql_servers.max_latency_ms is 0, the default value mysql-default_max_latency_ms applies.

System Variable Name mysql-default_max_latency_ms
Dynamic Yes
Permitted Values Type Integer (milliseconds)
Default 1000
Minimum 0
Maximum 1728000000

Note: due to a limitation in SSL implementation, it is recommended to increase mysql-default_max_latency_ms if using SSL.

mysql-default_net_write_timeout

Deprecated in version 2.0.11. See mysql-default_variables

The number of seconds to wait for a block to be written to a connection before aborting the write.

System Variable Name mysql-default_net_write_timeout
Dynamic Yes
Permitted Values Type Integer (seconds)
Default 60
Minimum 0
Maximum

mysql-default_query_delay

Simple throttling mechanism for queries to the backends. Setting this variable to a non-zero value (in miliseconds) will delay the execution of all queries, globally. There is a more fine-grained throttling mechanism in the admin table mysql_query_rules, where for each rule there can be one delay that is applied to all queries matching the rule. That extra delay is added on top of the default, global one.

System Variable Name mysql-default_query_delay
Dynamic Yes
Permitted Values Type Integer (milliseconds)
Default 0
Minimum 0
Maximum 3600000

mysql-default_query_timeout

Mechanism for specifying the maximal duration of queries to the backend MySQL servers until ProxySQL should return an error to the MySQL client. Whenever ProxySQL detects that a query has timed out, it will spawn a separate thread that runs a KILL query against the specific MySQL backend in order to stop the query from running in the backend. Because the query is killed, an error will be returned to the MySQL client.

System Variable Name mysql-default_query_timeout
Dynamic Yes
Permitted Values Type Integer (milliseconds)
Default 86400000
Minimum 1000
Maximum 1728000000

mysql-default_reconnect

Not used for now.

mysql-default_schema

The default schema to be used for incoming MySQL client connections which do not specify a schema name. This is required because ProxySQL doesn’t allow connection without a schema.

System Variable Name mysql-default_schema
Dynamic Yes
Permitted Values Type String
Default information_schema
Valid Values Any existing schema

mysql-default_session_track_gtids

Controls whether the server tracks GTIDs within the current session and returns them to the client. Depending on the variable value, at the end of executing each transaction, the server GTIDs are captured by the tracker. The GTID value is also returned to the client if required.

System Variable Name mysql-default_session_track_gtids
Dynamic Yes
Permitted Values Type
Default OFF
Valid Values valid only at SESSION scopeOFF: The tracker collects no GTIDs. This is the default.OWN_GTID: The tracker collects GTIDs generated by successfully committed read/write transactions.ALL_GTIDS: Not supported in ProxySQL

mysql-default_sql_auto_is_null

Deprecated in version 2.0.11. See mysql-default_variables

If this variable is enabled, then after a statement that successfully inserts an automatically generated AUTO_INCREMENT value, you can find that value by issuing a statement of the following form:
SELECT * FROM tbl_name WHERE auto_col IS NULL
If the statement returns a row, the value returned is the same as if you invoked the LAST_INSERT_ID() function. For details, including the return value after a multiple-row insert, see Section 12.15, “Information Functions”. If no AUTO_INCREMENT value was successfully inserted, the SELECT statement returns no rows.

System Variable Name mysql-default_sql_auto_is_null
Dynamic Yes
Permitted Values Type String
Default OFF
Valid Values ON|OFF

mysql-default_sql_mode

Deprecated in version 2.0.11. See mysql-default_variables

When a client requires a different sql_mode, ProxySQL needs to track the change to ensure that the needed sql_mode is the same on every backend connection used by that specific client.
When ProxySQL establishes a new connection to a backend it doesn’t know the current sql_mode. Although it is possible to query the backend to retrieve sql_mode and other variables, querying the backend has a latency cost. For this reason ProxySQL doesn’t query the backend to know the value of sql_mode, and instead it assumes that all the backend connections have by default the sql_mode defined in mysql-default_sql_mode.

If a client changes sql_mode to a value different than mysql-default_sql_mode, ProxySQL will ensure to change sql_mode on every connection used by that client.
On the other hand, if a client sets sql_mode to the same value specified in mysql-default_sql_mode, ProxySQL won’t change the sql_mode on the backend connection because it assumes that the sql_mode is already correct.

A misconfigured mysql-default_sql_mode can lead to unexpected results. For example, if mysql-default_sql_mode='' (the default in ProxySQL, and also the default for MySQL <= 5.6.5) while the backend has sql_mode different than '', if a client executes set session sql_mode='' ProxySQL won’t change the sql_mode on the backend.

This variable needs to be configured as the default sql_mode across all backends. If backends have different sql_mode or if you want ProxySQL to always enforce the sql_mode specified by the client, mysql-default_sql_mode can be configured using an invalid sql_mode. This will force ProxySQL to always change the sql_mode on the backend to whatever value is specified by the client.

System Variable Name mysql-default_sql_mode
Dynamic Yes
Permitted Values Type String
Default
Valid Values Any valid or invalid sql_mode

mysql-default_sql_safe_updates

Deprecated in version 2.0.11. See mysql-default_variables

If this variable is enabled, UPDATE and DELETE statements that do not use a key in the WHERE clause or a LIMIT clause produce an error. This makes it possible to catch UPDATE and DELETE statements where keys are not used properly and that would probably change or delete a large number of rows.

System Variable Name mysql-default_sql_safe_updates
Dynamic Yes
Permitted Values Type String
Default OFF
Valid Values ON|OFF

mysql-default_sql_select_limit

Deprecated in version 2.0.11. See mysql-default_variables

The maximum number of rows to return from SELECT statements.
The default value for a new connection is the maximum number of rows that the server permits per table. Typical default values are (232)−1 or (264)−1. If you have changed the limit, the default value can be restored by assigning a value of DEFAULT.
If a SELECT has a LIMIT clause, the LIMIT takes precedence over the value of sql_select_limit.

System Variable Name mysql-default_sql_select_limit
Dynamic Yes
Permitted Values Type Integer
Default DEFAULT
Valid Values The default value for a new connection is the maximum number of rows that the server permits per table. Typical default values are (232)−1 or (264)−1. If you have changed the limit, the default value can be restored by assigning a value of DEFAULT.

mysql-default_time_zone

Deprecated in version 2.0.11. See mysql-default_variables

If a client doesn’t specify any time_zone, the time zone assigned to the client is whatever time zone is currently assigned to mysql-default_time_zone. When a client requires a different time_zone, ProxySQL needs to track the change to ensure that the needed time_zone is the same on every backend connection used by that specific client. When ProxySQL establishes a new connection to a backend it doesn’t know the current time_zone. Although it is possible to query the backend to retrieve time_zone and other variables, querying the backend has a latency cost. For this reason ProxySQL doesn’t query the backend to know the value of time_zone, and instead it assumes that all the backend connections have by default the time_zone defined in mysql-default_time_zone.

If a client changes time_zone to a value different than mysql-default_time_zone, ProxySQL will ensure to change time_zone on every connection used by that client.
On the other hand, if a client sets time_zone to the same value specified in mysql-default_time_zone, ProxySQL won’t change the time_zone on the backend connection because it assumes that the time_zone is already correct.

A misconfigured mysql-default_time_zone can lead to unexpected results so this variable needs to be configured as the default time_zone across all backends. If backends have different time_zone or if you want ProxySQL to always enforce the time_zone specified by the client, mysql-default_time_zone can be configured using an invalid time_zone. This will force ProxySQL to always change the time_zone on the backend to whatever value is specified by the client.

<

System Variable Name mysql-default_time_zone
Dynamic Yes
Permitted Values Type String
Default SYSTEM
Valid Values Any valid or invalid MySQL time_zone

mysql-default_transaction_read

Deprecated in version 2.0.11. See mysql-default_variables

ProxySQL tracks the transaction access modes, READ WRITE or READ ONLY clause.
If manually set what is mandatory for ProxySQL is the SESSION scope definition:

- SET SESSION TRANSACTION READ WRITE
- SET SESSION TRANSACTION READ ONLY

SET TRANSACTION READ (WRITE|ONLY) is not supported, and it will automatically disable multiplexing.

In MySQL by default, a transaction takes place in read/write mode, with both reads and writes permitted to tables used in the transaction. This mode may be specified explicitly using SET **SESSION** TRANSACTION with an access mode of READ WRITE.

System Variable Name mysql-default_transaction_read
Dynamic Yes
Permitted Values Type String
Default WRITE
Valid Values READ|WRITE

mysql-default_tx_isolation

ProxySQL supports the change of the Transaction Isolation level ONLY at SESSION level.
Any attempts to run a command like SET TRANSACTION ISOLATION LEVEL value are not supported, and it will automatically disable multiplexing.
Correct syntax is: SET SESSION TRANSACTION ISOLATION LEVEL value

System Variable Name mysql-default_tx_isolation
Dynamic Yes
Permitted Values Type String
Default READ-COMMITTED
Valid Values READ COMMITTED, REPEATABLE READ, and SERIALIZABLE

mysql-log_mysql_warnings_enabled

Introduced in ProxySQL v2.1.1. If enabled, all generated MySQL warnings will be logged to ProxySQL log.

System Variable Name mysql-log_mysql_warnings_enabled
Dynamic Yes
Permitted Values Type Boolean
Default false

mysql-log_unhealthy_connections

If a client disconnects in a not graceful way and if is enabled (default), ProxySQL will log a warning Closing unhealthy client connection IP:port.
The most common reasons for a client to disconnect not gracefully are client just closing the socket without sending any QUIT packet, or a client disconnecting without even starting the MySQL authentication (action performed mostly by monitoring tools that are only checking if the port is open and accepting TCP connections)

System Variable Name mysql-log_unhealthy_connections
Dynamic Yes
Permitted Values Type Boolean
Default true

mysql-multiplexing

Enable multiplexing by default. We recommend to leave multiplexing on (the default).
Please note that multiplexing can still be disabled for other reasons, enabling this parameter makes sure it is never enabled.

System Variable Name mysql-multiplexing
Dynamic Yes
Permitted Values Type Boolean
Default true

mysql-enforce_autocommit_on_reads

System Variable Name mysql-enforce_autocommit_on_reads
Dynamic Yes
Permitted Values Type Boolean
Default false

mysql-eventslog_filename

If this variable is set, ProxySQL will log all traffic to the specified filename. Note that the log file is not a text file, but a binary log with encoded traffic. The value of this variable can be set to an absolute pathname (e.g. “/data/events_log/events_log” or else a filename (e.g. “events_log”) will be written to the defined data directory. A sequential number will always be suffixed in the file’s extension (e.g. “events_log.00000001”).

System Variable Name mysql-eventslog_filename
Dynamic Yes
Permitted Values Type String
Default empty string, not set
Valid Values A filename or absolute path

mysql-eventslog_filesize

This variable specifies the maximum size of files created by ProxySQL logger as specified in mysql-eventslog_filename. When the maximum size is reached, the file is rotated.

System Variable Name mysql-eventslog_filesize
Dynamic Yes
Permitted Values Type Integer (bytes)
Default 104857600 (100MB)
Minimum 1048576
Maximum 1073741824

mysql-eventslog_default_log

ProxySQL is able to log queries that pass through.
If there is no definition for Log in a matching rule in mysql_query_rules, mysql-eventslog_default_log applies.
See also https://github.com/sysown/proxysql/wiki/Query-Logging

System Variable Name mysql-eventslog_default_log
Dynamic Yes
Permitted Values Type Boolean
Default false

mysql-eventslog_format

From version 2.0.6 ProxySQL can handle two different log formats:

1 : this is the default: queries are logged in binary format (like before 2.0.6) 2 : the queries are logged in JSON format.

Default: 1
See also https://github.com/sysown/proxysql/wiki/Query-Logging

System Variable Name mysql-eventslog_format
Dynamic Yes
Permitted Values Type Integer
Default 1
Valid Values 1 : this is the default: queries are logged in binary format (like before 2.0.6)
2 : the queries are logged in JSON format.

mysql-forward_autocommit

When mysql-forward_autocommit=false (the default), ProxySQL will track (and remember) the autocommit value that the client wants and change autocommit on a backend connection as needed. For example, if a client sends set autocommit=0, ProxySQL will just reply OK. When the client sends a DDL, ProxySQL will get a connection to target hostgroup, and change autocommit before running the DDL.

If mysql-forward_autocommit=true, SET autocommit=0 is forwarded to the backend. SET autocommit=0 doesn’t start any transaction, the connection is set in the connection pool, and queries may execute on a different connection. If you set mysql-forward_autocommit=true, you should also set mysql-autocommit_false_not_reusable=true to prevent the connection to be returned to the connection pool. In other words, setting mysql-forward_autocommit=false will prevent this behaviour since the autocommit state is tracked.

System Variable Name mysql-forward_autocommit
Dynamic Yes
Permitted Values Type Boolean
Default false

mysql-free_connections_pct

ProxySQL uses a connection pool to connect to backend servers.
Connections to backend are never pre-allocated if there is no need, so at start up there will be 0 connections to the backend.
When an application starts sending traffic to ProxySQL, this identifies to which backend it needs to send traffic. If there is a connection in the connection pool for that backend, that connection is used, otherwise a new connection is created.
When the connection completes serving the client’s request, it is sent back to the the Hostgroup Manager. If the Hostgroup Manager determines that the connection is safe to share and the connection pool isn’t full, it will place it in the connection pool. Although, not all the unused connections are kept in the connection pool.
This variable controls the percentage of open idle connections from the total maximum number of connections for a specific server in a hostgroup.
For each hostgroup/backend pair, the Hostgroup Manager will keep in the connection pool up to mysql-free_connections_pct * mysql_servers.max_connections / 100 connections . Connections are kept open with periodic pings.

A connection is idle if it hasn’t been used since the last round of pings. The time interval between two such rounds of pings for idle connections is controlled by the variable mysql-ping_interval_server_msec.

System Variable Name mysql-free_connections_pct
Dynamic Yes
Permitted Values Type Integer (percentage)
Default 10
Minimum 0
Maximum 100

mysql-have_compress

Currently unused.

mysql-have_ssl

Introduced in ProxySQL v2.0, it enables frontend SSL support (see SSL Support for more information).

System Variable Name mysql-have_ssl
Dynamic Yes
Permitted Values Type Boolean
Default false

mysql-hostgroup_manager_verbose

Enable verbose logging of hostgroup manager details in ProxySQL logs (e.g. when running LOAD MYSQL SERVERS TO RUNTIME).

System Variable Name mysql-hostgroup_manager_verbose
Dynamic Yes
Permitted Values Type Integer
Default 1
Minimum 0
Maximum 2

mysql-init_connect

String containing one or more SQL statements, separated by semicolons, that will be executed by the ProxySQL for each backend connection when created or initialised e.g. SET WAIT_TIMEOUT=28800 (works similarly to MySQL’s init_connect variable).

System Variable Name mysql-init_connect
Dynamic Yes
Permitted Values Type String
Default empty string, not set
Valid Values String containing one or more SQL statements, separated by semicolons

mysql-interfaces

Semicolon-separated list of hostname:port entries for interfaces for incoming MySQL traffic. Note that this also supports UNIX domain sockets for the cases where the connection is done from an application on the same machine.
Note that changing this value has no effect at runtime, if you need to change it you have to restart the proxy.
After changing mysql-interfaces, you should not run LOAD MYSQL VARIABLES TO RUNTIME because this variable cannot be loaded at runtime. Attempt to load them at runtime will cause their reset.
In other words, after changing mysql-interfaces, you need to run SAVE MYSQL VARIABLES TO DISK and then restart ProxySQL (for example using PROXYSQL RESTART).

System Variable Name mysql-interfaces
Dynamic No
Permitted Values Type String
Default 0.0.0.0:6033;/tmp/proxysql.sock
Valid Values IP / hostname with ‘:’ seperated port and ‘;’ separated socket filename

mysql-keep_multiplexing_variables

Defines a list of variables that do not cause multiplexing to be disabled if queries.
For example “SELECT @@version”, by default proxysql would disable multiplexing.
But because “version” is in mysql-keep_multiplexing_variables, multiplexing is not disabled.
The list is defined in ProxySQL and is not dynamic.
Default: trx_isolation,version

mysql-max_stmts_cache

Set the total maximum number of statements that can be cached when using Prepare Statement.

System Variable Name mysql-max_stmts_cache
Dynamic Yes
Permitted Values Type Integer
Default 10000

mysql-kill_backend_connection_when_disconnect

When enabled the backend connection for a client connection is killed when the client disconnects (introduced in ProxySQL v2.0).

System Variable Name mysql-kill_backend_connection_when_disconnect
Dynamic Yes
Permitted Values Type Boolean
Default true

mysql-long_query_time

Threshold for counting queries passing through the proxy as ‘slow’. The total number of slow queries can be found in the stats_mysql_global table, in the variable named Slow_queries (each row in that table represents one variable).

System Variable Name mysql-long_query_time
Dynamic Yes
Permitted Values Type Integer (milliseconds)
Default 1000
Minimum 0
Maximum 1728000000

mysql-max_allowed_packet

mysql-max_allowed_packet defines the maximum size of a single packet/command received by the client. It mimics the behavior of mysqld’s max_allowed_packet

System Variable Name mysql-max_allowed_packet
Dynamic Yes
Permitted Values Type Integer (bytes)
Default 4194304 (4MB)
Minimum 8192 (8KB)
Maximum 1073741824 (1GB)

mysql-max_connections

The maximum number of client connections that the proxy can handle. After this number is reached, new connections will be rejected with the #HY000 error, and the error message Too many connections.

System Variable Name mysql-max_connections
Dynamic Yes
Permitted Values Type Integer
Default 2048
Minimum 1
Maximum 1000000

mysql-max_stmts_per_connection

The threshold for the number of statements that can be prepared on a backend connection before that connection is closed (prior to version 1.4.3) or reset (starting version 1.4.4). This is evaluated when a connection is returned to the connection pool.

System Variable Name mysql-max_stmts_per_connection
Dynamic Yes
Permitted Values Type Integer
Default 20
Minimum 1
Maximum 1024

mysql-max_transaction_time

Sessions with active transactions running more than this timeout are killed.

System Variable Name mysql-max_transaction_time
Dynamic Yes
Permitted Values Type Integer (milliseconds)
Default 14400000 (4 hours)
Minimum 1000
Maximum 1728000000

mysql-min_num_servers_lantency_awareness

Latency awareness is an algorithm used to send traffic only to the closest backends.
IE: In case of slaves in multiple AZs, ProxySQL will send traffic only to the slaves on the same AZ.
But to trigger this algorithm, a minimum number of servers is required.
In case of 3 slaves in 3 AZs, and application/ProxySQL is in one AZ, you MAY not want to send almost all the traffic to only one slave.

System Variable Name mysql-min_num_servers_lantency_awarenes
Dynamic Yes
Permitted Values Type Integer
Default 1000

mysql-mirror_max_concurrency

ToDo

System Variable Name mysql-mirror_max_concurrency
Dynamic Yes
Permitted Values Type Integer
Default 16
Minimum 1
Maximum 8192

mysql-mirror_max_queue_length

ToDo

System Variable Name mysql-mirror_max_queue_length
Dynamic Yes
Permitted Values Type Integer
Default 32000
Minimum 0
Maximum 1048576

mysql-ping_interval_server_msec

The interval at which the proxy should ping backend connections in order to maintain them alive, even though there is no outgoing traffic. The purpose here is to keep some connections alive in order to reduce the latency of new queries towards a less frequently used destination backend server.

System Variable Name mysql-ping_interval_server_msec
Dynamic Yes
Permitted Values Type Integer (milliseconds)
Default 10000
Minimum 1000
Maximum 604800000

mysql-ping_timeout_server

The proxy internally pings the connections it has opened in order to keep them alive. This eliminates the cost of opening a new connection towards a hostgroup when a query needs to be routed, at the cost of additional memory footprint inside the proxy and some extra traffic. This is the timeout allowed for those pings to succeed.

System Variable Name mysql-ping_timeout_server
Dynamic Yes
Permitted Values Type Integer (milliseconds)
Default 200
Minimum 10
Maximum 600000

mysql-poll_timeout

The minimal timeout used by the proxy in order to detect incoming/outgoing traffic via the poll() system call. If the proxy determines that it should stick to a higher timeout because of its internal computations, it will use that one, but it will never use a value less than this one.

System Variable Name mysql-poll_timeout
Dynamic Yes
Permitted Values Type Integer (milliseconds)
Default 2000
Minimum 10
Maximum 20000

mysql-poll_timeout_on_failure

The timeout used in order to detect incoming/outgoing traffic after a connection error has occured. The proxy automatically tweaks its timeout to a lower value in such an event in order to be able to quickly respond with a valid connection.

System Variable Name mysql-poll_timeout_on_failure
Dynamic Yes
Permitted Values Type Integer (milliseconds)
Default 100
Minimum 10
Maximum 20000

mysql-query_cache_size_MB

The total amount of memory used by the Query Cache, note: the current implementation of mysql-query_cache_size_MB doesn’t impose a hard limit . Instead, it is used as an argument by the purging thread.

System Variable Name mysql-query_cache_size_MB
Dynamic Yes
Permitted Values Type Integer (MB)
Default 256
Minimum 0
Maximum 10485760

mysql-query_cache_stores_empty_result

The variable controls if resultset without rows will be cached or not (introduced in ProxySQL v2.0).

System Variable Name mysql-query_cache_stores_empty_result
Dynamic Yes
Permitted Values Type Boolean
Default true

mysql-query_digests

When this variable is set to true, the proxy analyzes the queries passing through it and divides them into classes of queries having different values for the same parameters. It computes a couple of metrics for these classes of queries, all found in the stats_mysql_query_digest table. For more details, please refer to the admin tables documentation.
It is also very important to note that query digest is required to determine when multiplexing needs to be disabled, for example in case of TEMPORARY tables, SQL_CALC_FOUND_ROWS , GET_LOCK, etc.
Do not disable mysql-query_digests unless you are really sure it won’t break your application.

System Variable Name mysql-query_digests
Dynamic Yes
Permitted Values Type Boolean
Default true

mysql-query_digests_lowercase

When this variable is set to true, query digest is automatically converted to lowercase otherwise when false, query digests are case sensitive.

System Variable Name mysql-query_digests_lowercase
Dynamic Yes
Permitted Values Type Boolean
Default false

mysql-query_digests_max_digest_length

Defines the maximum length of digest_text as then reported in stats_mysql_query_digest

System Variable Name mysql-query_digests_max_digest_length
Dynamic Yes
Permitted Values Type Integer
Default 2048
Minimum 16
Maximum (up to 1.3.1) 65000
Maximum (from 1.3.2 onwards) 1048576

mysql-query_digests_max_query_length

Defines the maximum query length processed when computing query’s digest and digest_text

System Variable Name mysql-query_digests_max_query_length
Dynamic Yes
Permitted Values Type Integer
Default 65000
Minimum 16
Maximum (up to 1.3.1) 65000
Maximum (from 1.3.2 onwards) 16777216

mysql-query_digests_grouping_limit

Introduced in v2.1.0. Defines the maximum number of replacements in a digest by the placeholder ?. Elements in a digest will be replaced by the placeholder ?, until reaching element number N, after which all the elements will be compressed into ....

E.g: let the mysql-query_digests_grouping_limit=3 the following digest:

SELECT * FROM tablename WHERE id IN (1,2,3,4,5,6,7,8,9,10)

will be compressed into:

SELECT * FROM tablename WHERE id IN (?,?,?,...)
System Variable Name mysql-query_digests_grouping_limit
Dynamic Yes
Permitted Values Type Integer
Default 3
Minimum 1
Maximum 2089

mysql-query_digests_no_digits

When active ProxySQL will replace all numbers in the query to ‘?’ signs for generating digest. This functionality can be controlled by configuring the value of mysql-query_digests_no_digits.

System Variable Name mysql-query_digests_no_digits
Dynamic Yes
Permitted Values Type Boolean
Default false

mysql-query_digests_normalize_digest_text

When set to FALSE (default), ProxySQL will cache the SQL digest and related information in the table stats.stats_mysql_query_digest by schema.
When this variable is TRUE, queries statistics store digest_text on a different internal hash table. In this way ProxySQL will be able to normalize data, digest_text is internally stored elsewhere, and it deduplicates data.
When you query stats_mysql_query_digest, the data is merged together.
This drastically reduces memory usage on setups with many schemas but similar queries patterns.

System Variable Name mysql-query_digests_normalize_digest_text
Dynamic Yes
Permitted Values Type Boolean
Default false

mysql-query_digests_replace_null

When TRUE, ProxySQL will replace NULLs when creating the Query digest with ‘?’.
This approach will normalize statements like the following:

    SQL                                       Digest
    INSERT INTO tablename(id) VALUES (1);     INSERT INTO tablename(id) VALUES (?);
    INSERT INTO tablename(id) VALUES (NULL);  INSERT INTO tablename(id) VALUES (?);
    CALL spa(NULL, null, NULL, null);         CALL spa(?, ?, ?, ?);
    CALL spa(1, null, NULL, 4);               CALL spa(?, ?, ?, ?);
    CALL spa(1, 2, 3, 4);                     CALL spa(?, ?, ?, ?);
System Variable Name mysql-query_digests_replace_null
Dynamic Yes
Permitted Values Type Boolean
Default false

mysql-query_digests_track_hostname

If active it reports the original client address in the table stats_mysql_query_digest
See also https://github.com/sysown/proxysql/wiki/STATS-(statistics)

System Variable Name mysql-query_digests_track_hostname
Dynamic Yes
Permitted Values Type Boolean
Default false

mysql-query_processor_iterations

If mysql_query_rules.flagOUT is set and mysql-query_processor_iterations is greater than 0, a matching rule will set flagIN and starts processing rules from the beginning up to mysql-query_processor_iterations iterations.
Therefore, mysql-query_processor_iterations allows to jump back to previous mysql_query_rules.

System Variable Name mysql-query_processor_iterations
Dynamic Yes
Permitted Values Type Integer
Default 0
Minimum 0
Maximum 1000000

mysql-query_processor_regex

This variable defines which regex engine to use:

Before version v1.4.0, only RE2 was available, CASELESS was always enabled, and GLOBAL was always disabled.
Starting from v1.4.0, both PCRE and RE2 are available. Now both PCRE and RE2 support CASELESS and GLOBAL using re_modifiers.
Although, RE2 doesn’t support both CASELESS and GLOBAL at the same time if they are both configured in re_modifiers. For this reason, the default regex engine was changed to PCRE.

System Variable Name mysql-query_processor_regex
Dynamic Yes
Permitted Values Type Integer
Default PCRE 1
Valid Values PCRE 1
RE2 2

mysql-query_retries_on_failure

In case of failures while running a query, the same can be retried mysql-query_retries_on_failure times.

System Variable Name mysql-query_retries_on_failure
Dynamic Yes
Permitted Values Type Integer
Default 1
Minimum 0
Maximum 1000

mysql-reset_connection_algorithm

When reset_connection_algorithm = 2, MySQL_Thread itself tries to reset connections instead of relying on connections purger HGCU_thread_run() (introduced in ProxySQL v2.0), reset_connection_algorithm can be set to:

  • 1 = legacy algorithm used in ProxySQL v1.x
  • 2 = algorithm new since ProxySQL v2.0 (new default)
System Variable Name mysql-reset_connection_algorithm
Dynamic Yes
Permitted Values Type Integer
Default 2
Minimum 1
Maximum 2

mysql-server_capabilities

The bitmask of MySQL capabilities (encoded as bits) with which the proxy will respond to clients connecting to it.
This is useful in order to prevent certain features from being used, although it is planned to be deprecated in the future.
The default capabilities are:

server_capabilities = CLIENT_FOUND_ROWS | CLIENT_PROTOCOL_41 | CLIENT_IGNORE_SIGPIPE | CLIENT_TRANSACTIONS | CLIENT_SECURE_CONNECTION | CLIENT_CONNECT_WITH_DB | CLIENT_SSL;

More details about server capabilities in the official documentation.

System Variable Name mysql-server_capabilities
Dynamic Yes
Permitted Values Type Integer
Default 47626
Minimum 10
Maximum 65535

mysql-server_version

The server version with which the proxy will respond to the clients. Note that regardless of the versions of the backend servers, the proxy will respond with this.

System Variable Name mysql-server_version
Dynamic Yes
Permitted Values Type String
Default 5.5.30

mysql-servers_stats

Currently unused. Will be removed in a future version.

System Variable Name mysql-servers_stats
Dynamic Yes
Permitted Values Type Boolean
Default true

mysql-session_debug

DEPRECATED

System Variable Name mysql-session_debug
Dynamic Yes
Permitted Values Type Boolean
Default true

mysql-session_idle_ms

Starting from v1.3.0 , each MySQL_Thread has an auxiliary thread that is responsible to handle idle sessions (client connections). mysql-session_idle_ms defines when a session is idle and is passed from the main thread to the auxiliary thread.

System Variable Name mysql-session_idle_ms
Dynamic Yes
Permitted Values Type Integer (milliseconds)
Default 1000
Minimum 100
Maximum 3600000

mysql-session_idle_show_processlist

mysql-session_idle_show_processlist defines if an idle session (as defined by mysql-session_idle_ms) should be listed in SHOW PROCESSLIST (or in general, in stats_mysql_processlist table). For performance reasons, idle sessions are not listed by default.

System Variable Name mysql-session_idle_show_processlist
Dynamic Yes
Permitted Values Type Boolean
Default false

mysql-sessions_sort

Sessions are conversations between a MySQL client and a backend server in the proxy. Sessions are generally processed in a stable order but in certain scenarios (like using a transaction workload, which makes sessions bind to certain MySQL connections from the pool), processing them in the same order leads to starvation.

This variable controls whether sessions should be processed in the order of waiting time, in order to have a more balanced distribution of traffic among sessions.

System Variable Name mysql-sessions_sort
Dynamic Yes
Permitted Values Type Boolean
Default true

mysql-set_query_lock_on_hostgroup

When active (default from 2.0.6), if SET statement is used in multi-statements commands or if the parsing of SET statement is not successful, both multiplexing and query routing is disabled. The client will remain bound to a single backend connection. Any SET statement that ProxySQL doesn’t understand will disable multiplexing and routing.

System Variable Name mysql-set_query_lock_on_hostgroup
Dynamic Yes
Permitted Values Type Boolean
Default true

mysql-show_processlist_extended

When active ProxySQL will show extended information in JSON format about the processes running.
Information will be available in stats_mysql_processlist.extended_info

System Variable Name mysql-show_processlist_extended/td>
Dynamic Yes
Permitted Values Type Boolean
Default false

mysql-shun_on_failures

The number of connection errors tolerated to the same server within an interval of 1 second until it is automatically shunned temporarily. For now, this cannot be disabled by setting it to a special value, so if you want to do that, you can increase it to a very large value.

System Variable Name mysql-shun_on_failures
Dynamic Yes
Permitted Values Type Integer
Default 5
Minimum 0
Maximum 10000000

mysql-shun_recovery_time_sec

A backend server that has been automatically shunned will be recovered after at least this amount of time.
Note that if ProxySQL isn’t handling client traffic, there is no actual hard guarantee of the exact timing, but in practice it shouldn’t exceed this value by more than a couple of seconds.

Self tuning:

  • mysql-shun_recovery_time_sec should always be less than mysql-connect_timeout_server_max/1000 , in order to prevent that a server is taken out for so long that an error is returned to the client. If mysql-shun_recovery_time_sec > mysql-connect_timeout_server_max/1000 , the smaller of the two is used. (see #530)
  • if only one server is present in a hostgroup and mysql-shun_recovery_time_sec > 1 , the server is automatically brought back online after 1 second
System Variable Name mysql-shun_recovery_time_sec
Dynamic Yes
Permitted Values Type Integer (seconds)
Default 10
Minimum 0
Maximum 31536000

mysql-ssl_p2s_ca

SSL CA to be used for backend connections.

System Variable Name mysql-ssl_p2s_ca
Dynamic Yes
Permitted Values Type String
Default

mysql-ssl_p2s_cert

SSL Certificate to be used for backend connections.

System Variable Name mysql-ssl_p2s_cert
Dynamic Yes
Permitted Values Type String
Default

mysql-ssl_p2s_cipher

SSL Cipher to be used for backend connections (MySQL CIPHER list can be found here).

System Variable Name mysql-ssl_p2s_cipher
Dynamic Yes
Permitted Values Type String
Default

mysql-ssl_p2s_key

SSL Key to be used for backend connections.

System Variable Name mysql-ssl_p2s_key
Dynamic Yes
Permitted Values Type String
Default

mysql-stacksize

The stack size to be used with the background threads that the proxy uses to handle MySQL traffic and connect to the backends. Note that changing this value has no effect at runtime, if you need to change it you have to restart the proxy.

System Variable Name mysql-stacksize
Dynamic Yes
Permitted Values Type Integer (bytes)
Default 1048576
Minimum 262144
Maximum 4194304

mysql-stats_time_backend_query

Enables / disables collection of backend query CPU time statistics.

System Variable Name mysql-stats_time_backend_query
Dynamic Yes
Permitted Values Type Boolean
Default (up to 1.4.3) true
Default (from 1.4.4 onwards) false

mysql-stats_time_query_processor

Enables / disables collection of query processor CPU time statistics.

System Variable Name mysql-stats_time_query_processor
Dynamic Yes
Permitted Values Type Boolean
Default (up to 1.4.3) true
Default (from 1.4.4 onwards) false

mysql-tcp_keepalive_time

When mysql-use_tcp_keepalive is active, ProxySQL will start sending KeepAlive to the destination after the connection has been idle for tcp_keepalive_time seconds

System Variable Name mysql-tcp_keepalive_time
Dynamic Yes
Permitted Values Type Integer (seconds)
Default 0

mysql-use_tcp_keepalive

When active ProxySQL will send KeepAlive signal during the client open session.

System Variable Name mysql-use_tcp_keepalive
Dynamic Yes
Permitted Values Type Boolean
Default false

mysql-threads

The number of background threads that ProxySQL uses in order to process MySQL traffic. Note that there are other “administrative” threads on top of these, such as:

  • the admin interface thread
  • the monitoring module threads that interact with the backend servers (one for monitoring connectivity, one for pinging the servers and one for monitoring the replication lag)
  • occasional temporary threads created in order to kill long running queries that have become unresponsive
  • background threads used by the libmariadbclient library in order to make certain interactions with MySQL servers async

Note that changing this value has no effect at runtime, if you need to change it you have to restart the proxy.
After changing mysql-threads, you should not run LOAD MYSQL VARIABLES TO RUNTIME because this variable cannot be loaded at runtime. Attempt to load them at runtime will cause their reset.
In other words, after changing mysql-threads, you need to run SAVE MYSQL VARIABLES TO DISK and then restart ProxySQL (for example using PROXYSQL RESTART).

System Variable Name mysql-threads
Dynamic No
Permitted Values Type Integer
Default 4
Minimum 1
Maximum 255

mysql-threshold_query_length

The maximal size of an incoming SQL query to the proxy that will mark the background MySQL connection as non-reusable. This will force the proxy to open a new connection to the backend server, in order to make sure that the memory footprint of the server stays within reasonable limits.

More details about it here: https://dev.mysql.com/doc/refman/5.6/en/memory-use.html

Relevant quote from the mysqld documentation: “The connection buffer and result buffer each begin with a size equal to net_buffer_length bytes, but are dynamically enlarged up to max_allowed_packet bytes as needed. The result buffer shrinks to net_buffer_length bytes after each SQL statement.”

System Variable Name mysql-threshold_query_length
Dynamic Yes
Permitted Values Type Integer (bytes)
Default 524288
Minimum 1024
Maximum 1073741824

mysql-threshold_resultset_size

If a resultset returned by a backend server is bigger than this, ProxySQL will start sending the result to the MySQL client that was requesting the result in order to limit its memory footprint.

System Variable Name mysql-threshold_resultset_size
Dynamic Yes
Permitted Values Type Integer (bytes)
Default 4194304 (4MB)
Minimum 1024
Maximum 1073741824

Default value: 4194304 (bytes, the equivalent of 4 MB)

mysql-throttle_connections_per_sec_to_hostgroup

ToDo

mysql-throttle_max_bytes_per_second_to_client

ToDo

mysql-throttle_ratio_server_to_client

ToDo

mysql-verbose_query_error

When active ProxySQL will print additional information in case of error like: user, schema,digest_text, address, port.

System Variable Name mysql-verbose_query_error
Dynamic Yes
Permitted Values Type Boolean
Default false

mysql-wait_timeout

If a proxy session (which is a conversation between a MySQL client and a ProxySQL) has been idle for more than this threshold, the proxy will kill the session.

System Variable Name mysql-wait_timeout
Dynamic Yes
Permitted Values Type Integer (milliseconds)
Default 28800000 (8 hours)
Minimum 0
Maximum 1728000000