Docs

Convars

Every setting you can put in server.cfg. None of them are needed to get started; the defaults suit most servers.

A convar is one setting, written as one line in server.cfg: the word set, the convar's name, then its value. Put it above the ensure lines (the lines that start your resources), save the file and restart the server:

server.cfg
set waw_sql_pool_size 30
set waw_sql_auto_backup true

ensure qb-core

A convar you don't write keeps its default, shown in the tables below. A value with spaces in it goes in quotes.

Some settings are now made in the panel

The slow query threshold, slowing down runaway scripts, how long history is kept, the hour cleanup rules run and Discord's file limit are set in the panel under Maintenance. Their convars below still work, but only until the setting is saved in the panel; from then on the panel's value is used, and it stays after a restart.

Connection

The classic convars from oxmysql work unchanged.

convardefaultmeaning
mysql_connection_stringrequiredhow to reach your database, as a URL or key=value; pairs. How to write it: Connecting your database
mysql_debugfalsetrue writes every query to the console. That is a lot of text, so use it only while looking for a problem. For a single script, type oxmysql_debug add <resource> in the server console instead (until the next restart)
mysql_slow_query_warning200a query slower than this many ms counts as slow. In the panel: Slow query threshold under Maintenance → Settings
mysql_resultset_warning1000warn when a query returns more rows than this
mysql_transaction_isolation_level21 to 4; 2 is READ COMMITTED
mysql_logger_servicea logger service such as fivemanage; only errors are sent

Engine

These tune how waw-sql works inside. The defaults are right for almost every server: leave them as they are unless our support asks you to change one.

convardefaultmeaning
waw_sql_pool_size20number of connections in the pool. A connectionLimit in the connection string overrides it
waw_sql_warmuptrueopen all pool connections on start
waw_sql_singleflighttrueidentical SELECTs sent at the same moment run once and share the result
waw_sql_coalescetruebatch fast SELECTs together under load
waw_sql_coalesce_connections6extra connections used for that batching, on top of the pool
waw_sql_batch_transactiontruemulti-row prepare writes use one transaction
waw_sql_batch_interval1000how often the write queue is written, in ms
waw_sql_cache_max5000most results kept in the cache
waw_sql_oxmysql_compatautoanswer exports.oxmysql calls: auto, true or false

Files, history and backups

convardefaultmeaning
waw_sql_data_pathwaw-sql-datafolder for waw-sql's settings and history, relative to the server data folder
waw_sql_backup_pathwaw-sql-backupsbackup folder, relative to the server data folder
waw_sql_auto_backupfalseturn automatic backups on until a schedule is saved in the panel
waw_sql_view_cache_mb24tables larger than this are read from the backup file page by page when you look inside a backup
waw_sql_log_size3000how many recent queries the panel keeps in memory
waw_sql_history_days90how many days of history are kept. In the panel: Keep history (days) under Maintenance → Settings
waw_sql_startup_seconds30startup lasts while resources keep starting and ends this many seconds after the last one; startup queries are shown separately
waw_sql_audit_max_rows2000000the audit log drops its oldest records past this many rows

Cleanup rules

convardefaultmeaning
waw_sql_cleanup_hour5hour of the day, server time, after which cleanup rules run. In the panel: Runs at, above the cleanup rules
waw_sql_cleanup_chunk2000rows deleted per statement

Smart alerts

convardefaultmeaning
waw_sql_hotloop_count200the same query this many times within 10 seconds is reported as a loop
waw_sql_runaway_qps300queries per second from one script, 5 seconds in a row, reported as flooding
waw_sql_throttlefalseslow a flooding script down instead of only reporting it. In the panel: Slow down runaway scripts under Maintenance → Settings
waw_sql_throttle_qps150queries per second allowed to a script that is being slowed down. In the panel: next to Slow down runaway scripts

Discord and permissions

convardefaultmeaning
waw_sql_discord_file_mb10largest file Discord accepts on your server, for attached backups. In the panel: Discord file limit in the Discord log settings
waw_sql_discord_max_parts10most parts a large attached backup is split into
waw_sql_discord_tokena Discord bot token, needed for Discord role rules. Keep it secret: only put it in server.cfg
waw_sql_discord_guildyour Discord server's ID, for Discord role rules
waw_sql_ownersextra panel owners: identifiers separated by commas, such as license:1a2b3c...,discord:123456.... How to find yours: Who may do what