From 7677aad10a74decf4921097cb89108711a13f8b2 Mon Sep 17 00:00:00 2001 From: baldo Date: Fri, 29 Jul 2016 12:58:03 +0200 Subject: [PATCH] Fix: Dramatic slowdown when running the NodeInformationRetrievalJob --- server/services/monitoringService.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/services/monitoringService.js b/server/services/monitoringService.js index 4f60992..27b8a7a 100644 --- a/server/services/monitoringService.js +++ b/server/services/monitoringService.js @@ -22,7 +22,6 @@ angular.module('ffffng') ) { var MONITORING_STATE_MACS_CHUNK_SIZE = 100; var MONITORING_MAILS_DB_BATCH_SIZE = 50; - var MONITORING_MAX_PARALLEL_NODE_IMPORTS = 20; var MONITORING_OFFLINE_MAILS_SCHEDULE = { 1: { amount: 3, unit: 'hours' }, 2: { amount: 1, unit: 'days' }, @@ -532,9 +531,10 @@ angular.module('ffffng') } previousImportTimestamp = data.importTimestamp; - async.eachLimit( + // We do not parallelize here as the sqlite will start slowing down and blocking with too many + // parallel queries. This has resulted in blocking other requests too and thus in a major slowdonw. + async.eachSeries( data.nodes, - MONITORING_MAX_PARALLEL_NODE_IMPORTS, function (nodeData, nodeCallback) { Logger.tag('monitoring', 'information-retrieval').debug('Importing: %s', nodeData.mac);