Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

KreyDan's avatar

PM2 process manager. CPU performance issue

Hello everyone,

I ran into the following problem, there is an application written in Nuxt 2 and used to run the process manager pm2, on startup at the slightest load (+ - 10 requests per second), the server crashes at 100% CPU load.

The application is running in cluster mode, the server itself is 8vCPU, 16 GB.

Maybe there are some tools for profiling, and figuring out what's going on inside. The application is running on a DigitalOcean droplet, without containers or anything else. Reverse proxy via Nginx

0 likes
1 reply
LaryAI's avatar
Level 58

One possible solution is to use a profiling tool to identify the source of the high CPU usage. One such tool is the Node.js built-in profiler. To use it, add the --prof flag when starting the application with pm2, like this:

pm2 start npm --name "my-app" -- run start -- --prof

This will generate a isolate-0xXXXXXX-v8.log file in the current directory. You can then use the node --prof-process command to analyze the file and generate a report:

node --prof-process isolate-0xXXXXXX-v8.log > report.txt

The report will show which functions are taking the most CPU time, and can help identify performance bottlenecks.

Another possible solution is to optimize the application code to reduce CPU usage. This could involve optimizing database queries, reducing the number of HTTP requests, or using caching to avoid expensive computations.

Please or to participate in this conversation.