node js cpu 100%

前端 未结 5 1897
花落未央
花落未央 2020-12-24 13:13

We\'re having a problem where every once in a while one of our environments our node app runs on 100% CPU. The server isn\'t very active and usually runs on 0%-2% CPU. I was

5条回答
  •  时光说笑
    2020-12-24 13:40

    You can profile your app with node-tick.

    1. Install node-tick by npm -g install tick
    2. Run your app with enabled profile node --prof ./app.js
    3. After some time with CPU 100% usage stop your app
    4. You can see v8.log in your app directory, now you can read it with node-tick-processor
    5. Run node-tick-processor and explain results

提交回复
热议问题