very poor performance for serving static files

asdasd77 nginx-forum at nginx.us
Mon Jul 18 15:46:41 UTC 2011


we are a video hosting company and storing files in mp4 format. we have
another server, its litespeed and handle nearly 1gbit connection
succesfully. slow but it is responsing requests at least. but this new
server (nginx) cant handle requests. if bw usage hit the 150-200mbit its
going down. actually not down, just doesnt response any http request. we
tried and also hired someones and they tried but no success. this is the
last chance. is there anybody knows what the problem?

here is the nginx.conf
******************************************************************************************************************************************
#user  nobody;
worker_processes  8;
worker_rlimit_nofile 20480;

error_log  /var/log/nginx/error.log info;

#pid        logs/nginx.pid;


events {
worker_connections  768;
use epoll;
}


http {
    server_name_in_redirect off;
    server_names_hash_max_size 2048;
    include       mime.types;
    default_type  video/mp4;
    server_tokens off;
    #log_format  main  '$remote_addr - $remote_user [$time_local]
"$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    tcp_nopush on;
    tcp_nodelay on;
    connection_pool_size  256;

    #keepalive_timeout  0;
    #keepalive_timeout  300;

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  /var/log/nginx/access.log  combined;

        location / {
            root   /home/username/public_html;
            index  index.php index.html index.htm;


location ~* \.(mp4)$ {
    expires max;
    add_header Pragma public;
    add_header Cache-Control "public, must-revalidate,
proxy-revalidate";
}

       # location ~ \.flv {
       #     accesskey                    on;
       #     accesskey_hashmethod  md5;
       #     accesskey_arg              "key";
       #     accesskey_signature      "mypass$remote_addr";
       #     flv;
       # }

       # location ~ \.mp4 {
       #     accesskey                    on;
       #     accesskey_hashmethod  md5;
       #     accesskey_arg              "key";
       #     accesskey_signature      "mypass$remote_addr";
       #     mp4;
#  types {
#        video/mp4 mp4;
#    }
#        }


        location /nginx_status {
            stub_status on;
            access_log   off;
            allow all;
            #deny all;
        }

    }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on
127.0.0.1:9000
        #
        location ~ \.php$ {
            root           /home/cdn1280/public_html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME 
/home/username/public_html$fastcgi_script_name;
            include        fastcgi_params;
        }

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }
}
******************************************************************************************************************************************

and nginx -v


nginx: nginx version: 1.0.4


our server has 1tb hdd and 12gb ram and 8core cpu and 1gbit line

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,212555,212555#msg-212555




More information about the nginx mailing list