【发布时间】:2011-09-06 19:24:10
【问题描述】:
我在 nginx 反向代理后面托管了一个 RoR 应用程序,并将 nginx 配置为直接提供所有静态数据,而不将其传递给 RoR 应用程序(由瘦服务器托管)。
现在有趣的是图像、样式表、javascript 等的下载速度非常非常慢 1MB/s 的全速传输。
示例:
www.example.com/files/big_file.zip -> 很慢
www.example.com:3000/files/big_file.zip -> 非常棒
有人知道这个瓶颈可能发生在哪里吗?或者谁能给我一些nginx配置思路?
更多关于环境的信息: 英特尔酷睿 i7-920 四核 8GB 内存
Debian 挤压 Nginx 1.0.6
这是 nginx.conf
user www-data;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
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;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
# increase upload file sieze
client_max_body_size 200M;
}
最好的问候, 埃尔克诺基
【问题讨论】:
标签: ruby-on-rails performance static nginx thin