Conversation
Configure new SQLite connections to use WAL by default and apply synchronous=NORMAL when WAL is active. Keep explicit journal mode and synchronous overrides available for WordPress plugin connections, including initial installation.
|
CI timing notes from the first PR run: Baseline caveat:
The E2E improvements look heavily affected by setup/cache variance, especially browser install time. The WordPress PHPUnit test-step deltas are the more relevant signal for the WAL change. |
|
CI timing comparison after repeated runs: Methodology:
Median timings:
Low-level PHPUnit matrix medians were mixed:
Path-filtered manual-dispatch checks were mostly neutral/noisy. Readout: the strongest positive signal is WordPress PHPUnit with the Rust parser extension. Regular WordPress PHPUnit is essentially flat. E2E and low-level PHPUnit do not show a consistent WAL win in these CI samples. |
|
Local concurrent traffic benchmark against latest trunk: Methodology:
Median results:
Readout:
This benchmark is intentionally narrower than a full WordPress HTTP stack, but it exercises the production MySQL-on-SQLite driver with concurrent PHP processes and a WordPress-shaped read/write workload. The result is a much clearer WAL benefit than the GitHub Actions wall-clock timings, especially in tail latency under concurrent reads and writes. |
What changed
journal_mode = WAL.synchronous = NORMALwhen WAL is the effective journal mode.SQLITE_JOURNAL_MODEandSQLITE_SYNCHRONOUSoverrides wired through the WordPress plugin connection paths, including initial installation.Why
WAL improves read/write concurrency for SQLite-backed WordPress installs.
synchronous = NORMALavoids the extra transaction fsync cost that hurts throughput in WAL mode, while rollback-journal modes keep SQLite's default durability unless explicitly configured.Benchmark summary
A local 16-worker concurrent WordPress-shaped driver workload compared latest trunk using DELETE/FULL against latest trunk plus this change using WAL/NORMAL. WAL/NORMAL increased median throughput by about 3.2x on public 90R/10W traffic and about 4.1x on write-burst 70R/30W traffic, while cutting p95 latency by about 82-93% with zero
SQLITE_BUSYor other errors.Validation
./vendor/bin/phpunit -c ./phpunit.xml.dist tests/WP_SQLite_Connection_Tests.phpcomposer run testinpackages/mysql-on-sqlitecomposer run check-csgit diff --check