Open justb4 opened 4 months ago
Using
self._db_conn_cache.db.execute('PRAGMA synchronous=OFF')
self._db_conn_cache.db.execute('PRAGMA journal_mode=MEMORY')
improved seeding-speed dramatically but has some danger on sudden crashes...
Changes to improve tile seeding speed and fix errors during seeding for the Geopackage MapProxy TileCache.
1. Problem: locking errors
During seeding sometimes this error and seeder worker process dies/becomes zombie:
Analysis
The lock error is thrown in
_verify_table()
. Think this is the line:Two problems IMHO:
timeout
param is specified like in the conn-caching property function:self._db_conn_cache.db = sqlite3.connect(self.geopackage_file, timeout=self.timeout)
ensure_gpkg()
is called many times, whileself._db_conn_cache.db
(Thread local storage) may be availableFixes
Use timeouts:
with sqlite3.connect(self.geopackage_file, timeout=self.timeout) as db:
Related MapProxy issue/PR
TO BE DONE. Will first test here.
2. Problem : speed
Too slow often like 1500-5000 tiles/minute.
Analysis
Apart from disabling cache lock (remove
--use-cache-lock
) in seeder, some simple PRAGMA settings increased speed enormously:Small areas (muiden) tests
Full nl tests.
Latter gives nice view with
htop
, all busy but not too, memory ok: