<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
					xmlns:content="http://purl.org/rss/1.0/modules/content/"
					xmlns:wfw="http://wellformedweb.org/CommentAPI/"
					xmlns:atom="http://www.w3.org/2005/Atom"
				  >
<channel>
<atom:link rel="self"  type="application/rss+xml"  href="http://rulinux.net/rss_from_sect_4_subsect_13_thread_40781"  />
<title>rulinux.net - Форум - Web-development - Переход сервера в насыщение - чем объяснить?</title>
<link>http://rulinux.net/</link>
<description><![CDATA[Портал о GNU/Linux и не только]]></description>
<image><title>rulinux.net - Форум - Web-development - Переход сервера в насыщение - чем объяснить?</title>
<link>http://rulinux.net/</link>
<url>http://rulinux.net/rss_icon.png</url>
</image>
<item>
<title>Re:Переход сервера в насыщение - чем объяснить?</title>
<link>https://rulinux.net/message.php?newsid=40781&amp;page=1#190116</link>
<guid>https://rulinux.net/message.php?newsid=40781&amp;page=1#190116</guid>
<pubDate>Mon, 03 Feb 2014 14:23:10 +0400</pubDate>
<description><![CDATA[<p>А чем мерять посоветуешь? </p>]]></description>
</item>
<item>
<title>Re:Переход сервера в насыщение - чем объяснить?</title>
<link>https://rulinux.net/message.php?newsid=40781&amp;page=1#189969</link>
<guid>https://rulinux.net/message.php?newsid=40781&amp;page=1#189969</guid>
<pubDate>Sun, 02 Feb 2014 12:35:43 +0400</pubDate>
<description><![CDATA[<p>ab жутко врет на тестах с конкурентными коннекшанами, юзай что-то другое. По опыту могу сказать, что при тестировании асинхронных серверов с количеством одновременных подключений около 1000, разница с кипалайв и без примерно на порядок.</p>]]></description>
</item>
<item>
<title>Re:Переход сервера в насыщение - чем объяснить?</title>
<link>https://rulinux.net/message.php?newsid=40781&amp;page=1#189968</link>
<guid>https://rulinux.net/message.php?newsid=40781&amp;page=1#189968</guid>
<pubDate>Sun, 02 Feb 2014 12:35:20 +0400</pubDate>
<description><![CDATA[<p>Ну да, в том и дело - добавляешь один поток и он уже не может приконнектиться в течение секунды, хотя max-connections вроде это дело не ограничивает. Попробую нгинкс на досуге (вообще весь тест затевался для демонстранции незначительности оверхеда при работе без keep-alive, а это - побочное открытие..)</p>]]></description>
</item>
<item>
<title>Re:Переход сервера в насыщение - чем объяснить?</title>
<link>https://rulinux.net/message.php?newsid=40781&amp;page=1#189964</link>
<guid>https://rulinux.net/message.php?newsid=40781&amp;page=1#189964</guid>
<pubDate>Sun, 02 Feb 2014 12:07:09 +0400</pubDate>
<description><![CDATA[<p><i>>Однако, стоит начать долбить сервер в 132 потока, то максимальное время коннекта сразу подскакивает до целой секунды (второй тест в портянке в конце поста).</i><br> Я плохо понимаю в выводе ab, но выходит, что оно подскакивает до секунды на очень небольшой части запросов. В среднем у тебя 99% запросов завершаются за одно и то же время, так что это мелочь какая-то. Time per request практически одинаков.<br><br>Вообще, тут сложно что-то сказать, не зная внутренностей лайти. Попробуй ради интереса nginx на том же тесте с похожими настройками. Если у него будет проседание примерно на том же месте, то дело в системе, если нет - в лайти и его настройках. Как минимум можно будет исключить некоторые варианты. Можно ещё apache mpm-worker без лишних модулей прогнать в дополнение ко всему.</p>]]></description>
</item>
<item>
<title>Re:Переход сервера в насыщение - чем объяснить?</title>
<link>https://rulinux.net/message.php?newsid=40781&amp;page=1#189963</link>
<guid>https://rulinux.net/message.php?newsid=40781&amp;page=1#189963</guid>
<pubDate>Sun, 02 Feb 2014 11:18:10 +0400</pubDate>
<description><![CDATA[<p>Это вряд ли тебе сильно поможет</p>]]></description>
</item>
<item>
<title>Re:Переход сервера в насыщение - чем объяснить?</title>
<link>https://rulinux.net/message.php?newsid=40781&amp;page=1#189962</link>
<guid>https://rulinux.net/message.php?newsid=40781&amp;page=1#189962</guid>
<pubDate>Sun, 02 Feb 2014 11:02:31 +0400</pubDate>
<description><![CDATA[<p>Думаю, на этом месте будет уместно послать тебя на хуй.</p>]]></description>
</item>
<item>
<title>Re:Переход сервера в насыщение - чем объяснить?</title>
<link>https://rulinux.net/message.php?newsid=40781&amp;page=1#189959</link>
<guid>https://rulinux.net/message.php?newsid=40781&amp;page=1#189959</guid>
<pubDate>Sun, 02 Feb 2014 10:38:49 +0400</pubDate>
<description><![CDATA[<p>основными системными ресурсами. Мониторить можно, например, мониторингом</p>]]></description>
</item>
<item>
<title>Re:Переход сервера в насыщение - чем объяснить?</title>
<link>https://rulinux.net/message.php?newsid=40781&amp;page=1#189956</link>
<guid>https://rulinux.net/message.php?newsid=40781&amp;page=1#189956</guid>
<pubDate>Sun, 02 Feb 2014 10:19:28 +0400</pubDate>
<description><![CDATA[<p>&gt; Порог скорее всего зависит от конкретной конфигурации. 
<br><br>
Чтобы мы все длелали без вас, кэп :D
<br><br>
&gt; Плюс надо мониторить сам хост, что при этом на нём с системными ресурсами происходит
<br><br>
С какими ресурсами, как мониторить?
</p>]]></description>
</item>
<item>
<title>Re:Переход сервера в насыщение - чем объяснить?</title>
<link>https://rulinux.net/message.php?newsid=40781&amp;page=1#189946</link>
<guid>https://rulinux.net/message.php?newsid=40781&amp;page=1#189946</guid>
<pubDate>Sun, 02 Feb 2014 03:49:46 +0400</pubDate>
<description><![CDATA[<p>А зависимость от числа потоков какая должна быть по-твоему? Порог скорее всего зависит от конкретной конфигурации. Плюс надо мониторить сам хост, что при этом на нём с системными ресурсами происходит</p>]]></description>
</item>
<item>
<title>Переход сервера в насыщение - чем объяснить?</title>
<link>https://rulinux.net/message.php?newsid=40781&amp;page=1#189941</link>
<guid>https://rulinux.net/message.php?newsid=40781&amp;page=1#189941</guid>
<pubDate>Sun, 02 Feb 2014 02:06:57 +0400</pubDate>
<description><![CDATA[<p>Вопрос скорее из любопытства. <br>
Задался тут вопросом каков будет чистый оверхед при неиспользовании keep-alive в интранете (ну, в интернете понятно оно окупается стоимостью установления соединения через кучу хопов).
<br>
Сетап такой: старый однопроцессорный одноядерный лэптоп (проц Intel(R) Pentium(R) M processor 1.60GHz), который особо ничего не делает.
<br>
На лэптопе стоит lighttpd и по заданному урлу отдаёт статический файлик размером 14 байт. Беру Apache Bench и начинаю долбить сайт. Количество запросов постоянно, а количество параллельных потоков (опция -c) варьируется.
<br>
<br>
И вот что интересно, если посмотреть на портянку внизу, то при 131 потоке время, затраченное на &quot;Connect&quot; не превышает 13 миллисек - этот показатель варьируется, но не превышает 50 миллисек никогда.
<br>
<br>
Однако, стоит начать долбить сервер в 132 потока, то максимальное время коннекта сразу подскакивает до целой секунды (второй тест в портянке в конце поста). 
<br>
<br>
ИЧСХ, это стабильно воспроизводится от теста к тесту.
<br>
<br>
С разрешёнными Keepalive (Опция -k - два последних результата) потоков требуется больше, но &quot;насыщение&quot; всё равно наступает. Количество потоков незначительно варьируется - при повторном тесте с малым количеством потоков может дать макс.задержку соединения больше минуты, а если дать &quot;отдохнуть&quot; минутку - то опять всё хорошо.
<br>
<br>
Спрашивается - чем определяются эти пороги?
<br>
Настройки, в части на мой взгляд касающейся, такие:
<br>
<fieldset><legend>text</legend><div class="highlight text"><br />
server.max-connections = 1024<br />
server.max-keep-alive-idle = 5<br />
server.max-keep-alive-requests = 16<br />
&nbsp;</div></fieldset>
<br>
<br>
Ну и выхлоп бенчмарка:
<br>
<fieldset><legend>text</legend><div class="highlight text"><br />
$ ab -n 12000 -c 131 &nbsp; http://somehost/<br />
This is ApacheBench, Version 2.3 &lt;$Revision: 1430300 $&gt;<br />
...<br />
Server Software: &nbsp; &nbsp; &nbsp; &nbsp;lighttpd/1.4.32<br />
Server Hostname: &nbsp; &nbsp; &nbsp; &nbsp;somehost<br />
Server Port: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;80<br />
<br />
Document Path: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/<br />
Document Length: &nbsp; &nbsp; &nbsp; &nbsp;14 bytes<br />
<br />
Concurrency Level: &nbsp; &nbsp; &nbsp;131<br />
Time taken for tests: &nbsp; 3.189 seconds<br />
Complete requests: &nbsp; &nbsp; &nbsp;12000<br />
Failed requests: &nbsp; &nbsp; &nbsp; &nbsp;0<br />
Write errors: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0<br />
Total transferred: &nbsp; &nbsp; &nbsp;2964000 bytes<br />
HTML transferred: &nbsp; &nbsp; &nbsp; 168000 bytes<br />
Requests per second: &nbsp; &nbsp;3762.41 [#/sec] (mean)<br />
Time per request: &nbsp; &nbsp; &nbsp; 34.818 [ms] (mean)<br />
Time per request: &nbsp; &nbsp; &nbsp; 0.266 [ms] (mean, across all concurrent requests)<br />
Transfer rate: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;907.54 [Kbytes/sec] received<br />
<br />
Connection Times (ms)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; min &nbsp;mean[+/-sd] median &nbsp; max<br />
Connect: &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp;0 &nbsp; 0.7 &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp;13<br />
Processing: &nbsp; &nbsp; 5 &nbsp; 33 &nbsp;12.7 &nbsp; &nbsp; 32 &nbsp; &nbsp; 837<br />
Waiting: &nbsp; &nbsp; &nbsp; &nbsp;5 &nbsp; 33 &nbsp;12.6 &nbsp; &nbsp; 32 &nbsp; &nbsp; 837<br />
Total: &nbsp; &nbsp; &nbsp; &nbsp; 11 &nbsp; 33 &nbsp;12.7 &nbsp; &nbsp; 32 &nbsp; &nbsp; 837<br />
<br />
Percentage of the requests served within a certain time (ms)<br />
&nbsp; 50% &nbsp; &nbsp; 32<br />
&nbsp; 66% &nbsp; &nbsp; 33<br />
&nbsp; 75% &nbsp; &nbsp; 33<br />
&nbsp; 80% &nbsp; &nbsp; 33<br />
&nbsp; 90% &nbsp; &nbsp; 34<br />
&nbsp; 95% &nbsp; &nbsp; 36<br />
&nbsp; 98% &nbsp; &nbsp; 41<br />
&nbsp; 99% &nbsp; &nbsp; 42<br />
&nbsp;100% &nbsp; &nbsp;837 (longest request)<br />
<br />
<br />
<br />
$ ab -n 12000 -c 132 &nbsp; http://somehost/<br />
...<br />
<br />
Server Software: &nbsp; &nbsp; &nbsp; &nbsp;lighttpd/1.4.32<br />
Server Hostname: &nbsp; &nbsp; &nbsp; &nbsp;somehost<br />
Server Port: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;80<br />
<br />
Document Path: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/<br />
Document Length: &nbsp; &nbsp; &nbsp; &nbsp;14 bytes<br />
<br />
Concurrency Level: &nbsp; &nbsp; &nbsp;132<br />
Time taken for tests: &nbsp; 3.210 seconds<br />
Complete requests: &nbsp; &nbsp; &nbsp;12000<br />
Failed requests: &nbsp; &nbsp; &nbsp; &nbsp;0<br />
Write errors: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0<br />
Total transferred: &nbsp; &nbsp; &nbsp;2964000 bytes<br />
HTML transferred: &nbsp; &nbsp; &nbsp; 168000 bytes<br />
Requests per second: &nbsp; &nbsp;3738.32 [#/sec] (mean)<br />
Time per request: &nbsp; &nbsp; &nbsp; 35.310 [ms] (mean)<br />
Time per request: &nbsp; &nbsp; &nbsp; 0.268 [ms] (mean, across all concurrent requests)<br />
Transfer rate: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;901.72 [Kbytes/sec] received<br />
<br />
Connection Times (ms)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; min &nbsp;mean[+/-sd] median &nbsp; max<br />
Connect: &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp;0 &nbsp;12.9 &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp;1002<br />
Processing: &nbsp; &nbsp; 2 &nbsp; 33 &nbsp;12.9 &nbsp; &nbsp; 32 &nbsp; &nbsp; 837<br />
Waiting: &nbsp; &nbsp; &nbsp; &nbsp;2 &nbsp; 33 &nbsp;12.9 &nbsp; &nbsp; 32 &nbsp; &nbsp; 836<br />
Total: &nbsp; &nbsp; &nbsp; &nbsp; 12 &nbsp; 33 &nbsp;18.2 &nbsp; &nbsp; 32 &nbsp; &nbsp;1035<br />
<br />
Percentage of the requests served within a certain time (ms)<br />
&nbsp; 50% &nbsp; &nbsp; 32<br />
&nbsp; 66% &nbsp; &nbsp; 33<br />
&nbsp; 75% &nbsp; &nbsp; 33<br />
&nbsp; 80% &nbsp; &nbsp; 33<br />
&nbsp; 90% &nbsp; &nbsp; 34<br />
&nbsp; 95% &nbsp; &nbsp; 37<br />
&nbsp; 98% &nbsp; &nbsp; 38<br />
&nbsp; 99% &nbsp; &nbsp; 39<br />
&nbsp;100% &nbsp; 1035 (longest request)<br />
<br />
<br />
$ ab -n 12000 -c 167 &nbsp;-k http://somehost/<br />
...<br />
<br />
Server Software: &nbsp; &nbsp; &nbsp; &nbsp;lighttpd/1.4.32<br />
Server Hostname: &nbsp; &nbsp; &nbsp; &nbsp;somehost<br />
Server Port: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;80<br />
<br />
Document Path: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/<br />
Document Length: &nbsp; &nbsp; &nbsp; &nbsp;14 bytes<br />
<br />
Concurrency Level: &nbsp; &nbsp; &nbsp;167<br />
Time taken for tests: &nbsp; 1.524 seconds<br />
Complete requests: &nbsp; &nbsp; &nbsp;12000<br />
Failed requests: &nbsp; &nbsp; &nbsp; &nbsp;0<br />
Write errors: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0<br />
Keep-Alive requests: &nbsp; &nbsp;11376<br />
Total transferred: &nbsp; &nbsp; &nbsp;3020880 bytes<br />
HTML transferred: &nbsp; &nbsp; &nbsp; 168000 bytes<br />
Requests per second: &nbsp; &nbsp;7874.72 [#/sec] (mean)<br />
Time per request: &nbsp; &nbsp; &nbsp; 21.207 [ms] (mean)<br />
Time per request: &nbsp; &nbsp; &nbsp; 0.127 [ms] (mean, across all concurrent requests)<br />
Transfer rate: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1935.92 [Kbytes/sec] received<br />
<br />
Connection Times (ms)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; min &nbsp;mean[+/-sd] median &nbsp; max<br />
Connect: &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp;1 &nbsp;34.2 &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp;1002<br />
Processing: &nbsp; &nbsp; 0 &nbsp; 20 &nbsp; 6.0 &nbsp; &nbsp; 18 &nbsp; &nbsp; 220<br />
Waiting: &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; 20 &nbsp; 6.0 &nbsp; &nbsp; 18 &nbsp; &nbsp; 220<br />
Total: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; 21 &nbsp;34.4 &nbsp; &nbsp; 18 &nbsp; &nbsp;1020<br />
<br />
Percentage of the requests served within a certain time (ms)<br />
&nbsp; 50% &nbsp; &nbsp; 18<br />
&nbsp; 66% &nbsp; &nbsp; 19<br />
&nbsp; 75% &nbsp; &nbsp; 20<br />
&nbsp; 80% &nbsp; &nbsp; 21<br />
&nbsp; 90% &nbsp; &nbsp; 27<br />
&nbsp; 95% &nbsp; &nbsp; 31<br />
&nbsp; 98% &nbsp; &nbsp; 35<br />
&nbsp; 99% &nbsp; &nbsp; 40<br />
&nbsp;100% &nbsp; 1020 (longest request)<br />
$ ab -n 12000 -c 166 &nbsp;-k http://somehost/<br />
...<br />
<br />
Server Software: &nbsp; &nbsp; &nbsp; &nbsp;lighttpd/1.4.32<br />
Server Hostname: &nbsp; &nbsp; &nbsp; &nbsp;somehost<br />
Server Port: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;80<br />
<br />
Document Path: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/<br />
Document Length: &nbsp; &nbsp; &nbsp; &nbsp;14 bytes<br />
<br />
Concurrency Level: &nbsp; &nbsp; &nbsp;166<br />
Time taken for tests: &nbsp; 1.501 seconds<br />
Complete requests: &nbsp; &nbsp; &nbsp;12000<br />
Failed requests: &nbsp; &nbsp; &nbsp; &nbsp;0<br />
Write errors: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0<br />
Keep-Alive requests: &nbsp; &nbsp;11336<br />
Total transferred: &nbsp; &nbsp; &nbsp;3020680 bytes<br />
HTML transferred: &nbsp; &nbsp; &nbsp; 168000 bytes<br />
Requests per second: &nbsp; &nbsp;7995.17 [#/sec] (mean)<br />
Time per request: &nbsp; &nbsp; &nbsp; 20.763 [ms] (mean)<br />
Time per request: &nbsp; &nbsp; &nbsp; 0.125 [ms] (mean, across all concurrent requests)<br />
Transfer rate: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1965.40 [Kbytes/sec] received<br />
<br />
Connection Times (ms)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; min &nbsp;mean[+/-sd] median &nbsp; max<br />
Connect: &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp;0 &nbsp; 1.0 &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp;18<br />
Processing: &nbsp; &nbsp; 0 &nbsp; 20 &nbsp; 5.9 &nbsp; &nbsp; 19 &nbsp; &nbsp; &nbsp;59<br />
Waiting: &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; 20 &nbsp; 5.9 &nbsp; &nbsp; 19 &nbsp; &nbsp; &nbsp;59<br />
Total: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; 20 &nbsp; 6.0 &nbsp; &nbsp; 19 &nbsp; &nbsp; &nbsp;59<br />
<br />
Percentage of the requests served within a certain time (ms)<br />
&nbsp; 50% &nbsp; &nbsp; 19<br />
&nbsp; 66% &nbsp; &nbsp; 19<br />
&nbsp; 75% &nbsp; &nbsp; 19<br />
&nbsp; 80% &nbsp; &nbsp; 20<br />
&nbsp; 90% &nbsp; &nbsp; 27<br />
&nbsp; 95% &nbsp; &nbsp; 33<br />
&nbsp; 98% &nbsp; &nbsp; 41<br />
&nbsp; 99% &nbsp; &nbsp; 48<br />
&nbsp;100% &nbsp; &nbsp; 59 (longest request)<br />
&nbsp;</div></fieldset></p>]]></description>
</item>
</channel>
</rss>