Don't wait for the Postgres server's disk on every commit (#140)
Running the load tests on Postgres (#139) found a scan reading 1.2 feeds a second: after ten minutes the first of 1,500 had reached 1,136, where SQLite does them in 27s since #135. On the databases project's server, production's, 200 single-row inserts took 2,565ms as commits of their own, 12.8ms each waiting for the WAL to reach the disk (synchronous_commit=on), 56ms with synchronous_commit=off, and 67ms in one transaction. A feed's entries and enclosures are written a row at a time, about fifty commits for 20 new items, and production's scans paid the same. ipx's own sessions now set synchronous_commit=off, through sqlx's connect options, so it holds on top of whatever options a URL sets, the tests' search_path included. A crash of the Postgres server can lose the last commits, about the last 0.6s, and never corrupts anything; a crash of ipx loses nothing; other databases on the server keep their setting. The same first scan takes 20s, and the Rust tests on Postgres 3.3s instead of 7.1s. The test of SQLite's setting checks this one too when it runs on Postgres. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
### Fixed
|
||||
|
||||
- On Postgres, a write no longer waits for the database server's disk. A scan read about one feed a second and now reads 1,500 in 20 seconds.
|
||||
- Checking every feed no longer makes every icon in the feed list flash while it runs: the list keeps the icons it has already drawn.
|
||||
|
||||
### Security
|
||||
|
||||
Reference in New Issue
Block a user