Tune SQLite pragmas to reduce lock contention#12
Merged
Conversation
Adds temp_store/cache_size/wal_autocheckpoint tuning on top of Rails' built-in WAL defaults, ties pool size to RAILS_MAX_THREADS, and loosens synchronous/mmap_size/timeout in test to address the SQLite lock contention that PARALLEL_WORKERS=1 currently works around.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
temp_store,cache_size, andwal_autocheckpointSQLite pragmas inconfig/database.sqlite.yml, on top of Rails' built-in WAL/synchronous defaults.RAILS_MAX_THREADS(defaulting to 5, matching current behavior).timeout/synchronous/mmap_sizefor the test environment to reduce lock contention during parallel test runs (thePARALLEL_WORKERS=1workaround mentioned in AGENTS.md).Test plan
bin/rails runnerin development, test, and production environmentsbin/rails test test/modelswith default parallelization; no new failures introduced (3 pre-existing failures reproduced identically without this change)