我目前在Centos 6.6操作系统上运行nginx / 1.0.15。服务器具有以下规格:
- 英特尔(R)凌动(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)
我尝试了许多配置,几乎所有配置都给了我相同的结果..我非常沮丧。
服务器负载也永远不会超过0.3。
我的配置中是否有任何公然错误或误导的内容?可能有帮助。
配置
/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;
}
}