swapz83
swapz83

Reputation: 422

NodeJS idle operation during performance tests

Relative newbie to nodejs here trying to figure out a performance issue in a newly built application.

I am running a performance test on my node 0.12.7 app and I find the server hanging intermittently. It needs a restart upon reaching that state. After confirming there is no memory leak (the process heap does not exceed 500 MB whereas the default max-heap size is 1.4GB I understand), we moved to checking CPU profile. I have used this snippet of code with a dependency on v8-profiler to get regular profiles

Here is one of the charts that we encountered from jmeter (although the server didn't hang) Jmeter graph of requests

We plotted flame graphs in Chrome by loading the CPU profiles. I was expecting to find the JS stuck somewhere at this point, but I find that exactly in that time range, the node server is idle for a long time. Could anyone help me understand what could be the probable causes for the server to stay idle while being bombarded with client requests, and eventually recovering to continue operations after 10 minutes?

I unfortunately have lost the data to check if the responses between 16:48:10 and 16:57:40 are error or success, but it is very likely that they are error responses from the proxy since node didn't have a care in the world.

Here are the flame charts seen in Chrome

Upvotes: 1

Views: 1433

Answers (1)

rachna bafna
rachna bafna

Reputation: 501

There could be multiple reasons around this.

  1. Server is not accepting the requests. Do you see drop in throughput after you reach the peak?
  2. Have you checked the server logs to see if any exceptions are logged?
  3. Try plotting trends of response time and throughput for your test duration.
  4. You may want to see any IO bound operations in your code.
  5. Check the processor queue length. You should see it building up if processes are not getting enough CPU.

Upvotes: 1

Related Questions