Script timed out before returning headers: beanstalk.py

Question:

I deployed flask server using aws beanstalk.

When users were only 100, there was no problem,
but now we have 500 users, so sometimes beanstalk web application health transitions to Yellows (This happens one time a day or two days)

When health becomes yellow, the server does not respond… (around 1min)

If anybody knows this, then please help me.

The followings are the error log from beanstalk web application.

-------------------------------------
/var/log/httpd/error_log
-------------------------------------
[Mon Oct 13 01:47:07 2014] [error] [client x.x.x.x] Script timed out before returning headers: beanstalk.py
Asked By: Master Hong

||

Answers:

If your script is timing out because of too much load on one server you can consider using Auto Scaling options in beanstalk to get more servers to share the load.
Follow the instructions here to increase the Auto Scaling Group Min Size and Max Size:
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.managing.as.html

Elastic Beanstalk creates a load balancer for you so the load will be shared by all the instances.

You can also try using a bigger instance type like c3.large or m3.large for your application.

This is assuming if your application is not timing out because of excessive load caused by lots of simultaneous HTTP requests. I assume this is what you mean by 500 users.

Answered By: Rohit Banga