Background

Apache ShardingSphere can configure system-level configuration through property configuration. This section describes the configuration items in server.yaml.

Parameters

NameData TypeDescriptionDefaultDynamic Update
sql-show (?)booleanWhether to print SQL in logs.
Printing SQL can help developers quickly locate system problems. Logs contain the following contents: logical SQL, authentic SQL and SQL parsing result.
If configuration is enabled,logs will use Topic ShardingSphere-SQL,and log level is INFO。
falseTrue
sql-simple (?)booleanWhether to print simple SQL in logs.falseTrue
kernel-executor-size (?)intSet the size of the thread pool for task processing. Each ShardingSphereDataSource uses an independent thread pool,and different data sources on the same JVM do not share thread pools.infiniteFalse
max-connections-size-per-query (?)intThe maximum number of connections that a query request can use in each database instance.1True
check-table-metadata-enabled (?)booleanWhether shard metadata is checked for structural consistency when the program is started and updated.falseTrue
proxy-frontend-flush-threshold (?)intSet the I/O refresh threshold for the number of transmitted data items in ShardingSphere-Proxy.128True
proxy-hint-enabled (?)booleanWhether Hint is allowed in ShardingSphere-Proxy. Using Hint changes the Proxy’s threading model from IO multiplexing to a separate thread per request, reducing Proxy’s throughput.falseTrue
proxy-backend-query-fetch-size (?)intThe number of rows of data obtained when the backend Proxy interacts with databases (using a cursor). A larger number may increase the occupied memory of ShardingSphere-Proxy. The default value of -1 indicates the minimum value for JDBC driver.-1True
proxy-frontend-executor-size (?)intThe number of threads in the Netty thread pool of front-end Proxy.0False
proxy-backend-executor-suitable (?)StringOptions: OLAP and OLTP. The OLTP option may reduce the time overhead when writing packets to the client,but if the number of client connections exceeds proxy-frontend-executor-size,especially with slow SQL, it can cause a longer delay to SQL execution and even block connections to other clients.OLAPTrue
proxy-frontend-max-connections (?)intThe maximum number of clients that can be connected to Proxy. The default value of 0 indicates that there’s no limit.0True
sql-federation-type (?)StringSQL federation executor type, including: NONE, ORIGINAL, ADVANCED.NONETrue
proxy-mysql-default-version (?)StringProxy specifies the MySQL version through configuration files, and the default verison is 5.7.22.5.7.22False
proxy-default-port (?)StringProxy specifies the default window through configuration files.3307False
proxy-netty-backlog (?)intProxy specifies the default netty back_log parameter through configuration files.1024False
proxy-frontend-database-protocol-typeStringProxy front-end protocol type, supports MySQL, PostgreSQL, openGauss“”False

Property configuration can be modified according to DistSQL#RAL. Properties that support dynamic change can take effect immediately. Properties that do not support dynamic change take effect after a restart.

Sample

For a complete sample, please refer to server.yaml in ShardingSphere’s repository:https://github.com/apache/shardingsphere/blob/aac0d3026e00575114701be603ec189a02a45747/shardingsphere-proxy/shardingsphere-proxy-bootstrap/src/main/resources/conf/server.yaml#L71-L93