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.