Insight-api memory issue


(Armen Chakhalyan) #1

Hi All,

We have two servers and I created custom node as below presented on the first server.
Also I added insight-api service on the the first server. I need it to use it for the second sever, for sending requests from the second server to insight-api.

"use strict"
var bitcore = require('bitcore-node');
var bitcore_lib = require('bitcore-lib');
//Services
var Address = bitcore.services.Address;
var Bitcoin = bitcore.services.Bitcoin;
var DB = bitcore.services.DB;
var Web = bitcore.services.Web;
var Insight_Api = require('insight-api');

var node = new bitcore.Node({
    datadir: '/root/.bitcore/data',
    network: {
        name: 'livenet'
    },
    "services": [
        {
            name: "address",
            module: Address,
            config: {}
        },
        {
            name: 'bitcoind',
            module: Bitcoin,
            config: {}
        },
        {
            name: 'db',
            module: DB,
            config: {}
        },
        {
            name: 'web',
            module: Web,
            config: {
                port: 3001
            }
        },

        {
            name: 'insight-api',
            module: Insight_Api,
            config: {
                port: 3001
            }
        }

    ]
});


node.on('ready', function () {
    console.log('Bitcoin Node Ready');
});

node.on('error', function (err) {
    console.error(err);
});

node.start(function (err) {
    if(err) {
        console.log(err);
        node.stop();
    }
});

I faced the following main problem: it is created large memory link on the insight-api server.
After the running above code, it takes 10-12GB memory on the RAM during the 10 hours after what it is restarted.

Could anybody tell from were the problem comes and how to solve it?

For your information, I use Bitcore3 on that server.