Amarjit Singh
Amarjit Singh

Reputation: 2154

PM2 causing performance issue with mysql

when I run my Node js app by using node server.js command. It works without any performance issue. But when I start my app with pm2 start server.js then all the MySql queries starts taking too much time (around 1 to 2 Minutes). The problem occurs only with MySQL queries. The requests that don't execute any MySQL queries are responded without any delay. The problem is only with the APIs that includes any database interaction.

Upvotes: 1

Views: 767

Answers (1)

Admon Sasson
Admon Sasson

Reputation: 229

Is it possible that you have nvm installed, and that pm2 uses another version of node?

If so, just to test if it works fine with your current node version, try to run

pm2 start server.js --interpreter=~/.nvm/versions/node/`nvm current`/bin/node

Upvotes: 2

Related Questions