0

We are getting a "High Load" error on our website very frequently. On analyzing the logs we found the following error.

upstream timed out (110: Connection timed out) while reading response header from upstream.

The server configuration is as follows.

 server 
  {

    listen       443;
    server_name  example.com;
    client_max_body_size   20M;
    client_body_buffer_size   128k;

    ssl                  on;
    ssl_certificate     xxxxxxxxx;
    ssl_certificate_key  xxxxxxxxx;

    root       /home/xxx/xxx/xxx/public;
    passenger_enabled on;
    rails_env production;
    #passenger_max_request_queue_size 200;

    error_log  /usr/local/nginx/logs/xxxx.com/error.log;
    access_log  /usr/local/nginx/logs/xxx.com/access.log;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

  }

The server has a RAM of 4 GB and only one application is running on this server.

Does anyone know how to fix this?

prajeesh
  • 2,202
  • 6
  • 34
  • 59

1 Answers1

0

It looks like your application is not answering in a timely manner. If it is ok that the application takes so long to process something, you can increase the limit:

proxy_read_timeout 300;

If this is not an option you should have a look at your application, because that one is causing the problem. To solve the problem from that side, you should provide more details about the application.

Perhaps you want to have a look at this here too: The website is under heavy load + ROR

Community
  • 1
  • 1
Marged
  • 10,577
  • 10
  • 57
  • 99
  • Where do we add proxy_read_timeout ? Is it inside the server block? What is the default value of this? – prajeesh Jun 11 '15 at 08:11
  • @prajeesh I think 60seconds. You should definitely look this up on your own because this is all about basic configuration of your server. Even if it is written on stackoverflow you should never ever adapt values read on the internet and add it to your server configuration without checking it against the docs. – Marged Jun 11 '15 at 08:16