使用nginx跑靜態圖片經常在高併發情況下掛掉
最近使用nginx0.74在sorlrais10上跑靜態圖片伺服器 在高併發的情況下掛了好幾次了 不知道有人碰到過這問題沒? 附上我nginx的配置 大家幫忙看下 謝謝
---------------------------------------------------------------------------
user nobody;
worker_processes 64;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;
events {
use eventport;
worker_connections 20480;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
server_names_hash_bucket_size 128;
keepalive_timeout 65;
tcp_nodelay on;
access_log /dev/null;
error_log /dev/null;
gzip off;
# gzip_min_length 1k;
# gzip_buffers 4 8k;
# gzip_http_version 1.1;
# gzip_types text/plain application/x-javascript text/css application/html application/xml;
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
server { listen 80;
server_name photo.xxxx.com photo.xxxx.com;
index index.html index.htm ;
root /www2/photo;
error_page 404 /404.html;
location ~ \.(gif|jpg|jpeg|png|bmp|ico)$ {expires 7d;}
}
server { listen 80;
server_name clubfiles.xxxx.com clubfiles1.xxxx.com clubfiles2.xxxx.com clubfiles3.xxxx.com clubfiles4.xxxx.com c
lubfiles5.xxxx.com
index index.html index.htm ;
root /www1/clubfiles;
error_page 404 /404.html;
location ~ \.(gif|jpg|jpeg|png|bmp|ico)$ {expires 300d;}
}
server { listen 80;
server_name shopfiles.xxxx.com shopfiles.yyyy.com;
index index.html index.htm ;
root /www2/shopfiles;
error_page 404 /404.html;
location ~ \.(gif|jpg|jpeg|png|bmp|ico)$ {expires 300d;}
}
}
------------------------------------------------------------------------
《解決方案》
請提供掛掉前的error log