more cache

This commit is contained in:
Ben Wilson
2023-08-04 18:30:31 -04:00
parent d4bbd9ebef
commit 38681aba64
+4 -4
View File
@@ -18,12 +18,12 @@ export class AppService implements OnModuleInit {
async onModuleInit() { async onModuleInit() {
//https://phiresky.github.io/blog/2020/sqlite-performance-tuning/ //https://phiresky.github.io/blog/2020/sqlite-performance-tuning/
//100 MB DB cache //500 MB DB cache
await this.dataSource.query(`PRAGMA cache_size = -100000;`); await this.dataSource.query(`PRAGMA cache_size = -500000;`);
//Normal is still completely corruption safe in WAL mode, and means only WAL checkpoints have to wait for FSYNC. //Normal is still completely corruption safe in WAL mode, and means only WAL checkpoints have to wait for FSYNC.
await this.dataSource.query(`PRAGMA synchronous = normal;`); await this.dataSource.query(`PRAGMA synchronous = normal;`);
//1Gb //3Gb
await this.dataSource.query(`PRAGMA mmap_size = 1000000000;`); await this.dataSource.query(`PRAGMA mmap_size = 3000000000;`);
} }
@Cron(CronExpression.EVERY_HOUR) @Cron(CronExpression.EVERY_HOUR)