Engine & DB Tuning
MariaDB InnoDB Buffer Pool & my.cnf Tuning for QBCore/ESX
Keep active players, owned_vehicles, and ox_inventory tables resident in RAM using innodb_buffer_pool_size and O_DIRECT flush tuning.
2G - 16G Buffer Pool · trx_commit=2 · O_DIRECT NVMe
Escaping Disk-Bound Inventory Saves
Default distro MariaDB configs allocate only 128 MB to innodb_buffer_pool_size and enforce synchronous fsync on every single commit (innodb_flush_log_at_trx_commit = 1). Under QBCore stash writes, NVMe latency spikes immediately.
Safe my.cnf Settings for FiveM
Set innodb_flush_log_at_trx_commit = 2, innodb_flush_method = O_DIRECT, and innodb_io_capacity = 2000 in /etc/mysql/mariadb.conf.d/60-fivem.cnf to turn 120 ms save bursts into 4 ms in-memory writes.
Measured Thresholds & Server Configuration
| VDS RAM Tier | innodb_buffer_pool_size | innodb_buffer_pool_instances |
|---|---|---|
| 8 GB VDS (128 Slots) | 2G | 2 |
| 16 GB VDS (256 Slots) | 4G - 6G | 4 |
| 32 - 48 GB VDS (384-512 Slots) | 8G - 16G | 8 |