Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Puma "Terminating timed out worker" after rendering HTML

I am new to AWS Beanstalk-Rails-Puma-Nginx. After deploying my RAILS app to Beanstalk, all my api calls work fine, but HTML pages are causing error.

When opening my HTML page -

  1. Nginx throws 502 Bad Gateway error.
  2. Puma log :
    Started GET "/admin" for 182.70.76.160 at 2016-04-22 05:13:19 +0000 Processing by Devise::SessionsController#new as HTML Rendered devise/sessions/new.html.erb within layouts/application (6.1ms) [18858] ! Terminating timed out worker: 22913
  3. var/app/current/production.log is empty.

Read somewhere, that adding SSL could solve. Is it required to added SSL?

Please help! I am stuck!

STATUS : My assets were huge because of which it was killing itself. I was using a theme and removed all the unnecessary js, css and images.

Now, Puma doesn't terminate, but it doesnot compile assets. I had selected Ruby as application type so it should do it for me, correct?

like image 752
Disha Avatar asked Apr 22 '16 05:04

Disha


2 Answers

Try setting worker timeout to a higher value in puma config. Default value is 60 seconds

worker_timeout 100

It is possible that you are creating more workers than the server could handle. Try decreasing the worker count or increasing the server capacity.

like image 144
Sebin Avatar answered Oct 18 '22 23:10

Sebin


For now I moved to EC2 as EBS issues weren't getting solved. I had the same issue on EC2 but I could fix it as I access my machine.

Puma workers were timing out because my assets weren't precompiled. Everytime I take a new build on server, I have to run the following :

RAILS_ENV=production rake assets:precompile
like image 43
Disha Avatar answered Oct 19 '22 00:10

Disha