mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2025-03-18 05:41:43 +01:00
db tuning
This commit is contained in:
parent
0a03969f16
commit
f6f65ab9dc
@ -17,11 +17,14 @@ 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 = normal;`);
|
||||
await this.dataSource.query(`PRAGMA synchronous = off;`);
|
||||
//3Gb
|
||||
await this.dataSource.query(`PRAGMA mmap_size = 3000000000;`);
|
||||
}
|
||||
|
@ -32,8 +32,13 @@ export class StratumV1Service implements OnModuleInit {
|
||||
|
||||
if (process.env.ENABLE_SOLO == 'true') {
|
||||
//await this.clientStatisticsService.deleteAll();
|
||||
await this.clientService.deleteAll();
|
||||
this.startSocketServer();
|
||||
if (process.env.NODE_APP_INSTANCE == '0') {
|
||||
await this.clientService.deleteAll();
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.startSocketServer();
|
||||
}, 1000 * 10)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user