1

I have a node app that uses express and get data from mongodb and elastic search. On our production server, after some time, it starts to use CPU 100%, which makes the app unresponsive and we had to kill the process to make system idle.

I think there is a certain query (code) which is causing this issue. What are the latest practises to debug this kind of issue?

1 Answer 1

3

Start your app using:

node --prof app.js

It will dump a tick file in the current directory. Use the app, so the profiler can collect some data. Then stop the app, and analyse the tick file:

node --prof-process tick_file.log

This will give you breakdown of all calls, and you can find out which functions are hogging up the process. (Note that this second command might take a bit of time.)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.