Passenger Timeout issue on elasticbeanstalk

Course Queries Syllabus Queries 3 years ago

9.71K 1 0 0 0

User submissions are the sole responsibility of contributors, with TuteeHUB disclaiming liability for accuracy, copyrights, or consequences of use; content is for informational purposes only and not professional advice.

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 3 years ago


I've got a controller who list courses form a database :

# List with the courses'information from several sources
def list
  # retrieve courses info from database
  database_courses = Course.order('name ASC')

  # Create the JSON format and HTML to avoid errors
  respond_to do |format|
    format.html
    format.json { render :json => database_courses.to_json(
    :only => [  "course_code", 
                "id", 
                "name", 
                "start_at", 
                "end_at", 
                "published", 
                "sample_available",
                "course_id",
                "course_urlpath",
                "language",
                "difficulty_level",
                "video",
                "price_EUR",
                "price_promoted_EUR",
                "price_USD",
                "price_promoted_USD",
                "price_GBP",
                "price_promoted_GBP",
                "price_BRL",
                "price_promoted_BRL",
                "promotion",
                "duration",
                "discipline_id",
                "categorya_id",
                "categoryb_id", 
                "description",
                "syllabus",
                "interests",
                "overview",
                "requirements",
                "resources" ])}
  end
end

Was working perfect, but since the database is getting bigger, I receive this error each time I call the json :

[ pid=1366 thr=139991757182720 file=ext/nginx/HelperAgent.cpp:923 time=2013-11-25 11:21:57.687 ]: Couldn't forward the HTTP response back to the HTTP client: It seems the user clicked on the 'Stop' button in his browser.

And the json result isn't complete.

It's perfectly working locally with WEBrick and I've read a bit about that issue with passenger, but I can't figure how to setup these timeout parameters in an Elasticbeanstalk environment on AWS.

here are my nginx timeout setup for passenger :

ngx_conf_merge_msec_value(conf->upstream_config.connect_timeout,
                          prev->upstream_config.connect_timeout, 12000000);

ngx_conf_merge_msec_value(conf->upstream_config.send_timeout,
                          prev->upstream_config.send_timeout, 12000000);

ngx_conf_merge_msec_value(conf->upstream_config.read_timeout,
                          prev->upstream_config.read_timeout, 12000000);

Any help would be much appreciated :-D

0 views
0 shares

No matter what stage you're at in your education or career, TuteeHUB will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

Similar Forum