Skip to content

Commit

Permalink
sqlite: disable WAL mode
Browse files Browse the repository at this point in the history
Disable the write-ahead log [1] for sqlite.  Performance testing
suggests that WAL mode has a negative impact on Podman.  While most docs
suggest that WAL mode improves performance, it does not seem to apply to
Podman which tends to have very short-lived processes.

What I found most curious is that commands with many writes are faster
without WAL mode, for instance, `rm`, `stop`, `start`, etc.

Hence, let's move to as-close-to-default config of sqlite and enable
options only after thorough testing.

[NO NEW TESTS NEEDED] as it's a non-functional change.

[1] https://www.sqlite.org/wal.html

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
  • Loading branch information
vrothberg authored and edsantiago committed Mar 29, 2023
1 parent 7069beb commit 265fe61
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions libpod/sqlite_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ type SQLiteState struct {
const (
// Deal with timezone automatically.
sqliteOptionLocation = "_loc=auto"
// Set the journal mode (https://www.sqlite.org/pragma.html#pragma_journal_mode).
sqliteOptionJournal = "&_journal=WAL"
// Force WAL mode to fsync after each transaction (https://www.sqlite.org/pragma.html#pragma_synchronous).
sqliteOptionSynchronous = "&_sync=FULL"
// Allow foreign keys (https://www.sqlite.org/pragma.html#pragma_foreign_keys).
sqliteOptionForeignKeys = "&_foreign_keys=1"
// Make sure that transactions happen exclusively.
Expand All @@ -44,8 +40,6 @@ const (
// Assembled sqlite options used when opening the database.
sqliteOptions = "db.sql?" +
sqliteOptionLocation +
sqliteOptionJournal +
sqliteOptionSynchronous +
sqliteOptionForeignKeys +
sqliteOptionTXLock
)
Expand Down

0 comments on commit 265fe61

Please sign in to comment.