1
votes

I have 4 ec2 instances running on AWS. PM2 is running in cluster mode on all instances. When I get 5K+ Concurrent request, response time of app increases significantly.

All requests fetch redis key, and a normal fetch takes upto 10 seconds which without so many concurrent requests takes only 50ms. What can be issue here?

1

1 Answers

0
votes

We need to pinpoint the bottleneck. Let's do some diagnostics:

  1. Are the EC2 instances multicore to take advantage of PM2's clustering?

  2. When you execute pm2 start app.js -i X are you sure X=number_of_vCPUs of EC2 instance?

  3. When you execute pm2 monit do you see all instances of the cluster sharing the equal CPU and memory usage?

  4. When you run htop what is your total CPU and memory usage %?

  5. When you execute iftop what is your total of your RX and TX traffic compared to the maximum available in your machine?