Website under heavy load - ROR

765 views Asked by At

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?

1

There are 1 answers

2
Marged On

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