log GC duration and set to 10min interval
This commit is contained in:
parent
f6901823e6
commit
cdf7a4a1d8
|
@ -3,7 +3,10 @@
|
||||||
*/
|
*/
|
||||||
function forceGC() {
|
function forceGC() {
|
||||||
if (global.gc) {
|
if (global.gc) {
|
||||||
|
const startTime = Date.now();
|
||||||
global.gc();
|
global.gc();
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log(`GC took ${Date.now() - startTime}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ app.disable('x-powered-by');
|
||||||
|
|
||||||
|
|
||||||
// Call Garbage Collector every 30 seconds
|
// Call Garbage Collector every 30 seconds
|
||||||
setInterval(forceGC, 15 * 60 * SECOND);
|
setInterval(forceGC, 10 * 60 * SECOND);
|
||||||
|
|
||||||
// create http server
|
// create http server
|
||||||
const server = http.createServer(app);
|
const server = http.createServer(app);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user