LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-12-2009, 04:01 PM   #1
dezza
Member
 
Registered: Nov 2004
Location: Denmark
Distribution: ArchLinux, Debian, Gentoo, Ubuntu, VoidLinux
Posts: 133

Rep: Reputation: 18
Nginx Gateway 504 Timeout


Hello everyone.

I have a server with the following specifications:
Debian Etch
PHP 5.2.0-8+etch15 (cgi-fcgi) (built: May 1 2009 10:20:42)
Zend Engine v2.2.0
with eAccelerator v0.9.5.3 by eAccelerator
Nginx 0.6.34


I have a problem with an Nginx + FastCGI/PHP setup I've done.

I have around 12.000 users visiting the site in 1 hour, most of these are only small text returns but still everytime the server load is in meantime it can really pull out it's teeth.

If you restart it and put it on again it will develop over hours or days and eventually begin to issue alot of Gateway Timeouts.

I run Nginx with this configuration.
Code:
## GENERAL
pid                                             /var/run/nginx.pid;
user                                            www-data www-data;
worker_processes                                2;

events {
    worker_connections  1024;
}


http {
    include                                     mime.types;
    default_type                                 application/octet-stream;

## LOG FORMAT
    log_format  gzip  '$remote_addr - $remote_user [$time_local] $request '
                      '"$status" $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

## SIZE LiMiTS
#    client_body_buffer_size                    8k;
#    client_header_buffer_size                  1k;
    client_max_body_size                        5M;
#    large_client_header_buffers                        1 1k;

## TiMEOUTS
#    client_body_timeout                                5;
#    client_header_timeout                      5;
    keepalive_timeout                           5 5;
#    send_timeout                               5;

## GENERAL OPTiONS
    ignore_invalid_headers                      on;
    limit_zone gulag $binary_remote_addr        10m;
    #limit_req_zone $binary_remote_addr         zone=gulag:10m rate=1r/s;
    recursive_error_pages                       on;
    sendfile                                    on;
    server_name_in_redirect                     off;
    server_tokens                               off;

## TCP OPTiONS
    tcp_nodelay                                 on;
    tcp_nopush                                  on;

## COMPRESSiON
    gzip                                        on;
    gzip_buffers                                16 8k;
    gzip_comp_level                             9;
   # gzip_http_version                          1.0;
    gzip_min_length                             0;
    gzip_types                                  text/plain text/html text/css image/x-icon image/png;
    gzip_vary                                   on;

## COMPRESSION STATIC
   #gzip_static on;
   gzip_http_version 1.1;
   gzip_proxied expired no-cache no-store private auth;
   gzip_disable "MSIE [1-6] \.";

server {
    listen                      80;
    server_name                 localhost;

    access_log                  /var/log/nginx/access.log;
    error_log                   /var/log/nginx/error.log        info;
    expires                     31d;
    limit_conn                  gulag 5;
    root                        /var/www;
    index                       index.html index.htm index.php;

    location /phpmyadmin {
        deny all;
    }

    location ^~ /CONFIG/ {
        deny all;
    }

    # Pass PHP scripts to FastCGI server listening on 127.0.0.1:9000
    location ~ \.php$ {
         root           /var/www;
         fastcgi_pass   127.0.0.1:9000;#default: 127.0.0.1:9000
         fastcgi_index  index.php;
         fastcgi_param  SCRIPT_FILENAME  /var/www$fastcgi_script_name;
         fastcgi_send_timeout 60;
         include        fastcgi_params;
    }

    # Deny access to .htaccess files.
    location ~ /\.ht {
          deny all;
      }
    }
}
What can I do to further diagnostic this problem?

I have tried to assign the DNS servers recommended by the ISP.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Replacing Tomcat Error page 404 , 504 simon.unix Linux - Server 3 04-15-2009 04:34 AM
Linux On Archos 504? raid517 Linux - General 1 11-16-2006 08:09 AM
system memory still at 504 after video card install Furlinastis Slackware 6 07-21-2005 12:10 PM
Slow resolve of DNS names with DLink 504 ADSL router JGJones Linux - Networking 6 05-18-2004 06:02 PM
DHCP with my D-Link DSL-504 LadFromWales85 Linux - Networking 0 11-19-2003 04:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration