Unix NGINX服务大文件(mp4),效率极低
我目前正在Centos 6.6操作系统上运行nginx/1.0.15 服务器具有以下规格: 英特尔(R)Atom(TM)CPU C2750@2.40GHz(8核)Unix NGINX服务大文件(mp4),效率极低,unix,nginx,config,mp4,httpserver,Unix,Nginx,Config,Mp4,Httpserver,我目前正在Centos 6.6操作系统上运行nginx/1.0.15 服务器具有以下规格: 英特尔(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
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;
}
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;
}
}
/etc/nginx/conf.d/default.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;
}
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;
}
}
这个问题最好发到
http://serverfault.com
(stackexchange技术系统的一部分)。使用问题底部的标志
链接,请主持人将其移到那里。祝你好运。这个问题最好发到http://serverfault.com
(stackexchange技术系统的一部分)。使用问题底部的标志
链接,请主持人将其移到那里。祝你好运