Logo
Properties

Background #

Apache ShardingSphere provides a wealth of system configuration properties, which users can configure through server.yaml.

Parameters #

NameData TypeDescriptionDefault ValueDynamic effect
sql_federation_typeStringFederal query actuator types, including: NONE, ORIGINAL, ADVANCED.NONEYes
agent_plugins_enabledbooleanWhether to enable agent pluginTRUENo
transaction_typeStringTransaction Type (LOCAL/XA/BASE/MANUALXA)LOCALNo
kernel_executor_sizeintUsed to set the size of the task processing thread pool. Each ShardingSphereDataSource uses a separate thread pool and different data sources of the same JVM do not share thread pools.infiniteNo
max_connections_size_per_queryintThe maximum number of connections that can be used in each database instance for a single query request.1Yes
check_table_metadata_enabledbooleanWhether the structural consistency of the slice metadata is checked at program start and update.falseYes
proxy_frontend_flush_thresholdintSet the IO refresh threshold for the number of data entries transferred in the ShardingSphere-Proxy.128Yes
proxy_hint_enabledbooleanWhether to allow the use of Hint in ShardingSphere-Proxy, which changes the thread processing model of Proxy from IO multiplexing to a separate thread for each request, reducing the throughput of Proxy.falseYes
proxy_backend_query_fetch_sizeintThe number of rows of data fetched per Proxy backend interaction with the database (in the case of using cursors). Increasing the value may increase the memory usage of ShardingSphere Proxy. The default value is -1, which represents a setting to the minimum value for the JDBC driver.-1Yes
proxy_frontend_executor_sizeintNumber of Netty thread pool threads on Proxy front end, default value 0 means that the Netty default is used.0No
proxy_backend_executor_suitableStringOptional options: OLAP, OLTP. the OLTP option may reduce the time overhead of writing packets to clients, but it may increase the delay in SQL execution or even block connections from other clients if the number of client connections exceeds proxy-frontend-executor-size, especially when executing slow SQL.OLAPYes
proxy_frontend_max_connectionsintThe maximum number of clients allowed to connect to Proxy, the default value of 0 means no limit.0Yes
proxy_mysql_default_versionStringProxy specifies the version of MySQL via a configuration file, default version: 5.7.22. Only MySQL needs to be configured so that the client recognises the protocol version of the database.5.7.22No
proxy_default_portStringProxy specifies the default port via a configuration file.3307No
proxy_netty_backlogintProxy specifies the default netty back_log parameter via the configuration file.1024No
proxy_frontend_database_protocol_typeStringProxy front-end protocol type, supports MySQL, PostgreSQL, openGauss""No
proxy_instance_typeStringProxy instance type, options: Proxy, SphereEx:Proxy, Proxy for on-cloud deployment type, SphereEx:Proxy for local deployment typeProxyNo
system_log_levelStringSystem logging level, not built-in logger use this configuration, system logging level, support DEBUG, INFO, WARN, ERRORINFOYes
system_log_patternStringSystem log format, common across the board, log format can be found inLogback Layouts[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %logger{36} - %msg%nYes
sql_showboolean“Whether to print SQL in the system log.
Printing SQL can help developers to quickly locate system problems. The logs contain: logical SQL, real SQL and SQL parsing results.
If configured on, the logs will use Topic ShardingSphere-SQL and the syslog level is INFO.”
falseYes
sql_simplebooleanWhether to print simple style SQL in the system log.falseYes
slow_query_logbooleanWhether to enable slow queries TRUE/FALSEfalseYes
long_query_timeintSlow query threshold in ms10Yes
general_query_logbooleanWhether to enable full logging (audit log) TRUE/FALSEfalseYes
system_log_levelStringThe system log level of the current computing node (proxy) DEBUG, INFO, WARN, ERRORINFOYes
system_log_patternStringSystem log format of the current compute node (proxy)[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %logger{36} - %msg%nYes
storage_node_heartbeat_interval_millisecondsintUsed to configure the storage node status collection interval, in milliseconds. If the configuration is equal to 0, the storage node status collection function is turned off0Yes
meta_data_consistency_enabledbooleanUsed to control whether to enable proxy DDL and RDL consistency updatesfalseYes

Properties can be modified online through DistSQL. Properties that support dynamic change can take effect immediately. For the ones that do not support dynamic change, the effect will be implemented after a restart.

Sample #

For a complete sample


#props:
#  max-connections-size-per-query: 1
#  kernel-executor-size: 16  # Infinite by default.
#  proxy-frontend-flush-threshold: 128  # The default value is 128.
#  proxy-hint-enabled: false
#  sql-show: false
#  check-table-metadata-enabled: false
#  show-process-list-enabled: false
#    # Proxy backend query fetch size. A larger value may increase the memory usage of ShardingSphere Proxy.
#    # The default value is -1, which means set the minimum value for different JDBC drivers.
#  proxy-backend-query-fetch-size: -1
#  check-duplicate-table-enabled: false
#  proxy-frontend-executor-size: 0 # Proxy frontend executor size. The default value is 0, which means let Netty decide.
#    # Available options of proxy backend executor suitable: OLAP(default), OLTP. The OLTP option may reduce time cost of writing packets to client, but it may increase the latency of SQL execution
#    # and block other clients if client connections are more than `proxy-frontend-executor-size`, especially executing slow SQL.
#  proxy-backend-executor-suitable: OLAP
#  proxy-frontend-max-connections: 0 # Less than or equal to 0 means no limitation.
#  sql-federation-enabled: false
#    # Available proxy backend driver type: JDBC (default), ExperimentalVertx
#  proxy-backend-driver-type: JDBC
#  proxy-mysql-default-version: 5.7.22 # In the absence of schema name, the default version will be used.
#  proxy-default-port: 3307 # Proxy default port.
#  proxy-netty-backlog: 1024 # Proxy netty backlog.