nginx 处理请求时,同一个浏览器下,其中一个请求阻塞时,其他请求也会一直被阻塞。有碰到过这样的问题同学吗?
前提:
我是在vagrant下面配置nginx,首页里面有一个响应时间很长的ajax请求(如果去除这个ajax请求的话,首页很快就返回),每次要等这个ajax请求结束了,首页才会结束请求。我在内网的其他机子测试都没有这个问题,就是在本地的vagrant里面碰到这个问题。
nginx的配置如下
user www www;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
#worker_rlimit_nofile 65535;
events {
use epoll;
worker_connections 500;
}
http {
include 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 logs/access.log main;
#sendfile on;
#tcp_nopush on;
# keepalive_timeout 0;
keepalive_timeout 65;
......
}
推荐文章: