NGINX服务大文件(mp4),效率极低

时间:2015-07-14 00:15:59

标签: unix nginx config mp4 httpserver

我目前在Centos 6.6操作系统上运行nginx / 1.0.15。

服务器具有以下规格:

Intel(R)Atom(TM)CPU C2750 @ 2.40GHz(8核)
32GB拉杆
5 x 6000 GB 7200 RPM(Raid 10)

问题

服务器具有1Gbit / s连接,但是在400-500 mbit / s之后它会达到顶峰和瓶颈。大约100个连接的服务开始下降..服务器的速度急剧下降(尽管有50%的带宽可用)

NGINX服务器严格用于提供静态.mp4文件。每个文件通常为400-1200MB(平均700mb)

我尝试了很多配置,几乎所有配置都给了我相同的结果。

我的配置中是否有任何明显错误或误导?

配置

/etc/nginx/nginx.conf

user              nginx;
worker_processes  9;

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


pid        /var/run/nginx.pid;


events {
    worker_connections  51200;
    use epoll;
 }

worker_rlimit_nofile 600000;

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

    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  /var/log/nginx/access.log  main;
access_log off;

aio on;
sendfile        off;
tcp_nopush      off;
tcp_nodelay      on;

#keepalive_timeout  0;
keepalive_timeout  65;

output_buffers 1 3m;
#gzip  on;

include /etc/nginx/conf.d/*.conf;

open_file_cache          max=10000 inactive=5m;
open_file_cache_valid    2m;
open_file_cache_min_uses 1;
open_file_cache_errors   on;

}

/etc/nginx/conf.d/default.conf

server {
    listen       80 default_server sndbuf=32k;
    server_name  _;

    #charset koi8-r;

    #access_log  logs/host.access.log  main;

    include /etc/nginx/default.d/*.conf;


    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
    }

    location /Videos/ {
        root /home;
        gzip off;
        gzip_static off;

        mp4;
        mp4_max_buffer_size   300m;
    }

    location /stats {
        stub_status on;
    }

    error_page  404              /404.html;
    location = /404.html {
        root   /usr/share/nginx/html;
    }


    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
}

0 个答案:

没有答案