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:
set waw_sql_pool_size 30
set waw_sql_auto_backup true
ensure qb-coreA convar you don't write keeps its default, shown in the tables below. A value with spaces in it goes in quotes.
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.
| convar | default | meaning |
|---|---|---|
mysql_connection_string | required | how to reach your database, as a URL or key=value; pairs. How to write it: Connecting your database |
mysql_debug | false | true 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_warning | 200 | a query slower than this many ms counts as slow. In the panel: Slow query threshold under Maintenance → Settings |
mysql_resultset_warning | 1000 | warn when a query returns more rows than this |
mysql_transaction_isolation_level | 2 | 1 to 4; 2 is READ COMMITTED |
mysql_logger_service | a 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.
| convar | default | meaning |
|---|---|---|
waw_sql_pool_size | 20 | number of connections in the pool. A connectionLimit in the connection string overrides it |
waw_sql_warmup | true | open all pool connections on start |
waw_sql_singleflight | true | identical SELECTs sent at the same moment run once and share the result |
waw_sql_coalesce | true | batch fast SELECTs together under load |
waw_sql_coalesce_connections | 6 | extra connections used for that batching, on top of the pool |
waw_sql_batch_transaction | true | multi-row prepare writes use one transaction |
waw_sql_batch_interval | 1000 | how often the write queue is written, in ms |
waw_sql_cache_max | 5000 | most results kept in the cache |
waw_sql_oxmysql_compat | auto | answer exports.oxmysql calls: auto, true or false |
Files, history and backups
| convar | default | meaning |
|---|---|---|
waw_sql_data_path | waw-sql-data | folder for waw-sql's settings and history, relative to the server data folder |
waw_sql_backup_path | waw-sql-backups | backup folder, relative to the server data folder |
waw_sql_auto_backup | false | turn automatic backups on until a schedule is saved in the panel |
waw_sql_view_cache_mb | 24 | tables larger than this are read from the backup file page by page when you look inside a backup |
waw_sql_log_size | 3000 | how many recent queries the panel keeps in memory |
waw_sql_history_days | 90 | how many days of history are kept. In the panel: Keep history (days) under Maintenance → Settings |
waw_sql_startup_seconds | 30 | startup lasts while resources keep starting and ends this many seconds after the last one; startup queries are shown separately |
waw_sql_audit_max_rows | 2000000 | the audit log drops its oldest records past this many rows |
Cleanup rules
| convar | default | meaning |
|---|---|---|
waw_sql_cleanup_hour | 5 | hour of the day, server time, after which cleanup rules run. In the panel: Runs at, above the cleanup rules |
waw_sql_cleanup_chunk | 2000 | rows deleted per statement |
Smart alerts
| convar | default | meaning |
|---|---|---|
waw_sql_hotloop_count | 200 | the same query this many times within 10 seconds is reported as a loop |
waw_sql_runaway_qps | 300 | queries per second from one script, 5 seconds in a row, reported as flooding |
waw_sql_throttle | false | slow a flooding script down instead of only reporting it. In the panel: Slow down runaway scripts under Maintenance → Settings |
waw_sql_throttle_qps | 150 | queries per second allowed to a script that is being slowed down. In the panel: next to Slow down runaway scripts |
Discord and permissions
| convar | default | meaning |
|---|---|---|
waw_sql_discord_file_mb | 10 | largest file Discord accepts on your server, for attached backups. In the panel: Discord file limit in the Discord log settings |
waw_sql_discord_max_parts | 10 | most parts a large attached backup is split into |
waw_sql_discord_token | a Discord bot token, needed for Discord role rules. Keep it secret: only put it in server.cfg | |
waw_sql_discord_guild | your Discord server's ID, for Discord role rules | |
waw_sql_owners | extra panel owners: identifiers separated by commas, such as license:1a2b3c...,discord:123456.... How to find yours: Who may do what |
