From 4faa58e2c941bf29ed90e33b027db2c076ec6baa Mon Sep 17 00:00:00 2001 From: "longhoang.wkm" Date: Mon, 2 Mar 2020 11:14:19 +0700 Subject: [PATCH] Fix slow response chunkSize too small(10). Scan all block take n*M times. - M is average time to hit to leveldb - n = highestBlock / chunkSize Reduce n to help reduce response time --- lib/express.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/express.js b/lib/express.js index bb38d05..1065e42 100644 --- a/lib/express.js +++ b/lib/express.js @@ -37,7 +37,7 @@ module.exports = function initialize (adapter, opts) { } let maxResults = 100000 - let chunkSize = 10 + let chunkSize = 10000 let resultSizeMax = 200 if (process.env.MAX_ROWS_LEVELDB) { try {