Conexão lenta Nginx

3

Estou tentando diagnosticar um problema de conexão com o nginx no debian. existe um atraso de 2-10 segundos na conexão, estou usando o curl para testar:

curl -o /dev/null -w "Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} \n" -s http://example.com/forumhome.css
Connect: 0.657 TTFB: 1.183 Total time: 7.150


Aqui está um pastebin da saída tcpdump para a solicitação de curl acima: link


Eu também testei usando o webpagetest.org de diferentes locais e o mesmo problema de conexão existe.

os arquivos são servidos de um ssd montado em outra máquina.

Linux principal 2.6.32-5-amd64 # 1 SMP quarta-feira 18 de maio 23:13:22 UTC 2011 x86_64 GNU / Linux

nginx conf:

user www-data;
worker_processes  4;
worker_rlimit_nofile 802768;
error_log  /var/log/nginx/error.log;
pid        /var/run/nginx.pid;

events {
use epoll;
worker_connections 60000;
multi_accept on;
}

http {
include       /etc/nginx/mime.types;

#  access_log   /var/log/nginx/access.log;
access_log off;
sendfile        off;
keepalive_timeout  75;
tcp_nodelay        on;
keepalive_requests   2000;
connection_pool_size       8192;
client_body_buffer_size     1024K;
client_header_buffer_size   8k;
client_max_body_size          10M;
fastcgi_buffers 4 256k;
fastcgi_buffer_size 128k;
fastcgi_busy_buffers_size 256k;
large_client_header_buffers 8 8k;
ignore_invalid_headers          on;

client_header_timeout  60;  
client_body_timeout    60;
send_timeout          60;   

output_buffers   8 32k;
postpone_output  0;
server_name_in_redirect off;
server_tokens           off;

tcp_nopush  on;

gzip on;
gzip_min_length  1100;
gzip_buffers    32 8k;
    gzip_comp_level 2;
gzip_types       text/plain text/html application/x-javascript text/xml text/css text/javascript;
gzip_vary on;

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
    }

sysctl aqui - > pastebin systcl

site.conf:

open_file_cache max=5000 inactive=20s;
open_file_cache_valid    30s;
open_file_cache_min_uses 2;
open_file_cache_errors   on;

server {
listen   80 ; ## listen for ipv4

server_name example.com;    
root /mnt/ssd/www/static;

location ~* \.(css|js)$ {

expires max;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";

}
}

ifconfig eth0:

eth0  Link encap:Ethernet  HWaddr 00:15:17:26:b4:bd  
      inet addr:x.x.x.x  Bcast:x.x.x.x  Mask:255.255.254.0
      inet6 addr: fe80::215:17ff:fe26:b4bd/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:9000  Metric:1
      RX packets:1136534270 errors:0 dropped:0 overruns:0 frame:0
      TX packets:623191419 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:174357516836 (162.3 GiB)  TX bytes:323522620298 (301.3 GiB)
      Memory:e1a00000-e1a20000 

cat / proc / cpuinfo:

model name  : Intel(R) Core(TM)2 Quad CPU    Q6600  @ 2.40GHz

cat / proc / meminfo:

MemTotal:        4058884 kB
MemFree:         3366684 kB
Buffers:          117632 kB
Cached:           288320 kB
    
por waz 07.03.2012 / 22:40

1 resposta

1

Melhor verificar suas pesquisas de DNS para frente e (especialmente) reversas. Esta é uma causa comum de "lenta".

    
por 08.03.2012 / 00:11