Re: всплески времени ответа на кеширующем сервере

Игорь Хомяков homyakov на embria.ru
Вт Дек 29 01:42:18 MSK 2009


с curl картина такая же и уже понятно что это не dns

ttotal: 2.608, tlookup: 0.000, tconnect:0.039
ttotal: 0.080, tlookup: 0.000, tconnect:0.040
ttotal: 0.079, tlookup: 0.000, tconnect:0.039
ttotal: 0.086, tlookup: 0.000, tconnect:0.040
ttotal: 0.079, tlookup: 0.000, tconnect:0.039
ttotal: 0.079, tlookup: 0.000, tconnect:0.039
ttotal: 0.080, tlookup: 0.000, tconnect:0.039
ttotal: 0.080, tlookup: 0.000, tconnect:0.040
ttotal: 0.110, tlookup: 0.000, tconnect:0.039
ttotal: 3.116, tlookup: 0.000, tconnect:0.040


2009/12/27 CoolCold <coolcold на coolcold.org>:
> Hello Игорь,
>
> Friday, December 25, 2009, 7:07:20 PM, you wrote:
>
> ИХ> Здравствуйте!
>
> ИХ> кеширующий nginx, FreeBSD 7.2 amd64, 6Gb Ram
>
> ИХ> proxy_cache_path  /usr/mem_disk/cache levels=1:2
> ИХ> keys_zone=MEMDISK:128m inactive=3d max_size=1600M;
> ИХ> proxy_cache_key  $scheme$proxy_host$uri$is_args$args;
>
> ИХ> # proxy_cache_valid  72h;
> ИХ> proxy_cache_valid  200 301 302 304 72h;
>
> ИХ> proxy_cache_use_stale   updating error timeout invalid_header;
> ИХ> proxy_ignore_client_abort on;
>
>
> ИХ> запускаю на соседнем сервере
> ИХ> while true; do time wget -q -O /dev/null $image_url; sleep 2; done
>
> ИХ> вижу
> ИХ> wget -q -O /dev/null   0.00s user 0.00s system 3% cpu 0.083 total
> ИХ> wget -q -O /dev/null   0.00s user 0.00s system 1% cpu 0.127 total
> ИХ> wget -q -O /dev/null   0.00s user 0.00s system 4% cpu 0.082 total
> ИХ> wget -q -O /dev/null   0.00s user 0.00s system 0% cpu 5.277 total
> ИХ> wget -q -O /dev/null   0.00s user 0.00s system 4% cpu 0.082 total
> ИХ> wget -q -O /dev/null   0.00s user 0.00s system 3% cpu 0.083 total
> ИХ> wget -q -O /dev/null   0.00s user 0.00s system 1% cpu 0.126 total
> ИХ> wget -q -O /dev/null   0.00s user 0.00s system 1% cpu 0.158 total
> ИХ> wget -q -O /dev/null   0.00s user 0.00s system 2% cpu 0.104 total
> ИХ> wget -q -O /dev/null   0.00s user 0.00s system 1% cpu 0.120 total
> ИХ> wget -q -O /dev/null   0.00s user 0.00s system 4% cpu 0.083 total
> ИХ> wget -q -O /dev/null   0.00s user 0.00s system 3% cpu 0.128 total
> ИХ> wget -q -O /dev/null   0.00s user 0.00s system 2% cpu 0.163 total
> ИХ> wget -q -O /dev/null   0.00s user 0.00s system 2% cpu 0.124 total
> ИХ> wget -q -O /dev/null   0.00s user 0.00s system 0% cpu 4.668 total
> ИХ> wget -q -O /dev/null   0.00s user 0.00s system 1% cpu 0.184 total
>
> ИХ> то есть каждый 10-12 запрос отдается с серьезной задержкой
> 5 секунд похоже на timeout dns запроса и повтор, например из-за потери пакета.
>
> Попробуйте вместо wget'a curl, примерно так:
> coolcold на coolcold:~$ curl -w 'ttotal: %{time_total}, tlookup: %{time_namelookup}, tconnect:%{time_connect}\n' http://ya.ru/favicon.ico -o /dev/null 2>/dev/null
> ttotal: 0.319, tlookup: 0.029, tconnect:0.173
>
>
> ИХ> на сервере в это время работает 4 worker-а и cache loader обновляет данные
>
> ИХ> Грешил на медленный HDD, но при отдаче с md картина та же самая.
> ИХ> sysctl -a | grep vnode
> ИХ> kern.maxvnodes: 1000000
> ИХ> kern.minvnodes: 25000
> ИХ> vm.stats.vm.v_vnodepgsout: 0
> ИХ> vm.stats.vm.v_vnodepgsin: 1269012
> ИХ> vm.stats.vm.v_vnodeout: 0
> ИХ> vm.stats.vm.v_vnodein: 266964
> ИХ> vfs.freevnodes: 25065
> ИХ> vfs.wantfreevnodes: 25000
> ИХ> vfs.numvnodes: 200612
> ИХ> debug.sizeof.vnode: 504
>
>
> Best regards,
> CoolCold [COOLCOLD-RIPN]
>
>
> _______________________________________________
> nginx-ru mailing list
> nginx-ru на nginx.org
> http://nginx.org/mailman/listinfo/nginx-ru
>



-- 
WBR
Igor Homyakov
System Administrator, Embria



Подробная информация о списке рассылки nginx-ru