ASQL docs / Performance & Operations

Configuration

The service reads /etc/aios/asql.conf, a file of KEY=value lines. Restart after a change: sudo systemctl restart aios-compute. /opt/aios/bin/asql-serve --print shows the command the file produces.

Server

KeyDefaultMeaning
AIOS_ROOT/opt/aios/rootdata directory
SQL_DBsql_dbstore directory under the root
MYSQL_PORT3307MySQL port
MYSQL_BIND0.0.0.0listen address; 127.0.0.1 whenever no MYSQL_USER is set
MYSQL_USERnonemain login
MYSQL_PASS_FILEnonefile whose first line is the main login's password
MYSQL_SOCKETnoneUnix socket path
MYSQL_TLS_CERT, MYSQL_TLS_KEYnoneenable TLS
MYSQL_TLS_REQUIREoff1: remote clients must use TLS
MYSQL_CHARSEToff1: honour the client's character set
RPC_PORT7311JSON RPC port
PUBLICoff1: JSON RPC listens beyond 127.0.0.1
TOKEN_FILEnoneJSON RPC token

Replication

CDC_HOST, CDC_PORT, CDC_USER, CDC_PASS_FILE, CDC_DB, CDC_TABLES, CDC_LOG_FILE, CDC_LOG_POS. See Mirroring MySQL and MariaDB.

Environment

Set these in the service's environment (sudo systemctl edit aios-compute, then Environment=NAME=value):

VariableDefaultEffect
AIOS_REDO_SYNC1when commits reach the disk; see Durability
AIOS_SQL_STRICToff1: strict sql_mode by default
AIOS_SQL_SECURE_FILE_PRIVnonedirectory server-side LOAD DATA INFILE may read
AIOS_SQL_CACHE_MBon0 turns the result cache off
AIOS_SQL_FKon0 stops enforcing foreign keys
AIOS_THINGS_HISTORY2history lines kept per Thing key
AIOS_TXN_CONCURRENTon0: one transaction writes at a time
AIOS_CDC_TRACEoff1: log every applied replication change

Files

PathHolds
/etc/aios/asql.confconfiguration (readable by root and the aios group)
/opt/aios/binprograms
/opt/aios/rootdata: the store, users, capability key, license
/opt/aios/root/sql_db/connections.iniprofiles Things and Cells write to