question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I am noticing a big increase in memory usage between the releases 3.1.3 and 4.0.0 and above.

Our app is running on node 0.12.6 and we create our elasticsearch client with the following properties:

var esClient = new elasticsearch.Client({
  hosts: localhost:9200,
  apiVersion: "1.3",
  minSockets: 10,
  maxSockets: 10
});

When running on 3.1.3 we converge around 350-400MB. When upgrading to 4.0.0 or any later release the memory just seems to grow until hitting the v8-limit (1,4GB).

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:20
  • Comments:20 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
andrewstokercommented, Jul 11, 2016

@spalger Is this leaky behaviour still being investigated in the newer versions beyond 3.1.4? We are on node v4.4.5 and with any elasticsearch.js client above 4.x, the memory usage is far higher, leaking and behaving much differently as observed by @dylancwood. See below two charts.

V3.1.4 client:

image

V11.0.1 client:

image

Both are with the following client configuration (hosts commented out) :

elasticsearch: {
        hosts:           [
            'http://xxxxx:9200',
            'http://xxxxx:9200',
            'http://xxxxx:9200'
        ],
        minSockets:             10,
        maxSockets:             100
    }
1reaction
dylancwoodcommented, Apr 2, 2016

I think that I am experiencing the same issue. We are running a relatively thin proxy layer between our mobile clients and elastic search. Each node of that layer is receiving around 300 requests per minute. When we upgraded to Node 4+, we ran into max-stack depth exceeded errors with elasticsearch-js 3.1.3, so we upgraded to the latest version.

Memory consumption went up about four-fold with just this little change. To confirm that elasticsearch-js is responsible, I forked the repo and fixed the max-stack depth exceeded issue by pulling in a change from later versions of elasticsearch-js (https://github.com/dylancwood/elasticsearch-js/blob/3-1-3-speed/src/lib/log.js#L66).

Below are graphs of memory consumption, throughput and response time for two servers. Both servers are running Node 4.3.0, and were inundated with as many requests as they could handle for about 15 minutes (hence the poor response time). The only difference is that the red one is using elasticsearch-js 4.0.0 and the yellow one is using my patched fork of elasticsearch-js 3.1.3. Note that the response time is actually better on the 4.0.0 version 👍, but 700MB of memory is a high price to pay. Also, I cannot explain why the response time is faster on the 4.0.0 server, but the throughput is lower…

screen shot 2016-04-01 at 9 54 11 pm

@spalger: I hope you’ll consider this to be solid evidence. FTR, we use only three methods of this package: mget, search and indices.analyze.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MEMORY USAGE - Redis
The MEMORY USAGE command reports the number of bytes that a key and its value require to be stored in RAM. The reported...
Read more >
View memory usage in Activity Monitor on Mac - Apple Support
In Activity Monitor, view the amount of system memory being used on your Mac, including physical, compressed, wired, and app memory.
Read more >
Memory utilization - IBM
Memory is not managed as a single component, such as a CPU or disk, but as a collection of small components called pages....
Read more >
6 Ways to Check Memory Usage - wikiHow
1. Hold down Alt+Ctrl and press Delete. Doing so will open your Windows computer's task manager menu. 2. Click Task Manager. It's the...
Read more >
How to Check Memory Usage in Android - YouTube
I show you can use check memory usage on an Android phone.The apps I used in this video are:RAM Booster (Memory Cleaner) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found