1

I have an Elastic Beanstalk instance running Ruby on Rails using Puma with Ruby 2.6 running on 64bit Amazon Linux/2.11.7, the instance is scaled to a c5.2xlarge and a database of db.m5.large.

The instance is unable to handle more than 500 concurrent GET requests against the home page without returning a 502 gateway status. There are no operations being carried out and the CPU utilisation usually remains around 30%.

I will typically get the following error from the NGINX logs:

connect() to unix:///var/run/puma/my_app.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: xx.xx.xx.x, server: _, request: "GET / HTTP/1.1", upstream: "http://unix:///var/run/puma/my_app.sock:/", host: "domain.com"

Please note: I have hidden my domain and IP for privacy reasons.

I have tried a number of solutions as well as contacted amazon support with no avail to the problem.

Any help would be greatly appreciated.

kenlukas
  • 3,101
  • 2
  • 16
  • 26

1 Answers1

0

If you running in Amazon Linux 1, look at this answer: https://stackoverflow.com/a/66201704/384964.

The gist is that Beanstalk already have Puma set up so you need to move your puma gem into development.

If you are on Amazon Linux 2, you don't encounter this issue, but will need to set up a Procfile to run your rails server.

oky_sabeni
  • 109
  • 1
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 02 '22 at 11:29