postgres init

This commit is contained in:
Ben Wilson
2023-12-04 00:34:33 -05:00
parent f7303d73af
commit 39c4c033e2
11 changed files with 305 additions and 85 deletions
+1 -10
View File
@@ -17,16 +17,7 @@ export class AppService implements OnModuleInit {
}
async onModuleInit() {
// if (process.env.NODE_APP_INSTANCE == '0') {
// await this.dataSource.query(`VACUUM;`);
// }
//https://phiresky.github.io/blog/2020/sqlite-performance-tuning/
//500 MB DB cache
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.
await this.dataSource.query(`PRAGMA synchronous = off;`);
//6Gb
await this.dataSource.query(`PRAGMA mmap_size = 6000000000;`);
}
@Interval(1000 * 60 * 60)