Nginx-ru mailing list archive (nginx-ru@sysoev.ru)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
nginx VS apache: Количество одновременных TCP соединений
- To: nginx-ru@xxxxxxxxx
- Subject: nginx VS apache: Количество одновременных TCP соединений
- From: "Lex Lyamin" <flx@xxxxxxxxxxx>
- Date: Tue, 22 Aug 2006 18:35:04 +0400
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:mime-version:content-type:x-google-sender-auth; b=gyPsvKDpdk8p5yiqa+DMEmYlYNCy0hCMnXoTnr/tz/XysJiL3ymFdDEs4badLztdZJ/NWmvvxxJM7dXQ7ctpNe+GV0kCtC2ogQX3NnR6bXaek9zhGcGMq5onlK1sCN59Og4ceclbHWAT6DWh+efnPdtmJss9BuGgQnfRC6StV4g=
Hi gents,
Столкнулся со следующей ситуацией:
Есть некая html страничка, достаточно богатая обьектами Content-Type: image/jpeg. Есть два сервера отдающих эту страничку и эти image/jpeg.
Apache case:
Summary,Group,Protocol,Count Sequence,HTTP,HTTP/1.1 200 OK\r\n,40 Sequence,TCP,Connection establish request (SYN): 29471 -> http,1 Sequence,TCP,Connection establish acknowledge (SYN+ACK): http -> 29471,1
Sequence,HTTP,GET /register.php HTTP/1.1\r\n,1 Sequence,HTTP,GET /style/face.css HTTP/1.1\r\n,1 Sequence,HTTP,GET /js/common.js HTTP/1.1\r\n,1 Sequence,HTTP,GET /js/ac_runactivecontent.js HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-reg_introimg-
l-brd.jpg HTTP/1.1\r\n,1 Sequence,TCP,Connection establish request (SYN): 29472 -> http,1 Sequence,TCP,Connection establish request (SYN): 29473 -> http,1 Sequence,TCP,Connection establish acknowledge (SYN+ACK): http -> 29472,1
Sequence,HTTP,GET /images/tbl-reg_uzor-left-top.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_uzor-left-bottom.gif HTTP/1.1\r\n,1 Sequence,TCP,Connection establish acknowledge (SYN+ACK): http -> 29473,1
Sequence,HTTP,GET /counter?id=1097265;t=55;js=13;r=;j=true;s=1280*768;d=32;rand=0.10840907616180973 HTTP/1.1\r\n,1 Sequence,TCP,Connection finish (FIN): 29471 -> http,1 Sequence,TCP,Connection finish (FIN): http -> 29471,1
Sequence,TCP,Connection establish request (SYN): 29474 -> http,1 Sequence,HTTP,GET /images/users-arrow.gif HTTP/1.1\r\n,1 Sequence,TCP,Connection finish (FIN): http -> 29473,1 Sequence,TCP,Connection finish (FIN): 29473 -> http,1
Sequence,TCP,Connection establish acknowledge (SYN+ACK): http -> 29474,1 Sequence,HTTP,GET /images/tbl-reg_menu-top.jpg HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_menu-top-right.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/users-
arrow-org.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_news-active-r.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_info-top.jpg HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_reg-1.gif HTTP/1.1\r\n,1
Sequence,TCP,Connection finish (FIN): http -> 29472,1 Sequence,TCP,Connection finish (FIN): 29472 -> http,1 Sequence,HTTP,GET /images/tbl-reg_intbl-corner-top-right.gif HTTP/1.1\r\n,1 Sequence,TCP,Connection establish request (SYN): 29475 -> http,1
Sequence,TCP,Connection establish acknowledge (SYN+ACK): http -> 29475,1 Sequence,HTTP,GET /images/tbl-reg_intbl-corner-top-left.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_btn-step2.gif HTTP/1.1\r\n,1
Sequence,HTTP,GET /images/tbl-reg_intbl-corner-bottom-left.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-reg_intbl-corner-bottom-right.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_menu-bottom-right.gif
HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_news-sep-l.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_news-sep-r.gif HTTP/1.1\r\n,1 Sequence,TCP,Connection finish (FIN): 29474 -> http,1 Sequence,TCP,Connection finish (FIN): http -> 29474,1
Sequence,TCP,Connection establish request (SYN): 29476 -> http,1 Sequence,HTTP,GET /images/tbl-mn_uzor-right-top.gif HTTP/1.1\r\n,1 Sequence,TCP,Connection establish acknowledge (SYN+ACK): http -> 29476,1
Sequence,HTTP,GET /images/tbl-reg_introimg-r-brd.jpg HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_uzor-right-bottom.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_brd-left2.jpg HTTP/1.1\r\n,1 Sequence,TCP,Connection finish (FIN): 29475 -> http,1
Sequence,TCP,Connection finish (FIN): http -> 29475,1 Sequence,TCP,Connection establish request (SYN): 29477 -> http,1 Sequence,TCP,Connection establish acknowledge (SYN+ACK): http -> 29477,1 Sequence,HTTP,GET /images/tbl-mn_bg.jpg HTTP/1.1\r\n,1
Sequence,HTTP,GET /images/tbl-mn_menu-bg.jpg HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_news-active-l.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_news-active-c.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_menu-
bottom.jpg HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-reg_intbl-top.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_info-bg.jpg HTTP/1.1\r\n,1 Sequence,TCP,Connection finish (FIN): http -> 29476,1 Sequence,TCP,Connection finish (FIN): 29476 -> http,1
Sequence,TCP,Connection establish request (SYN): 29478 -> http,1 Sequence,TCP,Connection establish acknowledge (SYN+ACK): http -> 29478,1 Sequence,HTTP,GET /images/tbl-reg_intbl-left.gif HTTP/1.1\r\n,1
Sequence,HTTP,GET /images/tbl-reg_intbl-bg.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-reg_intbl-right.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-usi_bg-light.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_brd-
right2.jpg HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-reg_intbl-bottom.gif HTTP/1.1\r\n,1 Sequence,TCP,Connection finish (FIN): 29477 -> http,1 Sequence,TCP,Connection finish (FIN): http -> 29477,1
Итого 8 одновременных tcp соединений. Общее время загрузки страницы - 0.765 sec.
NGINX case:
Summary,Group,Protocol,Count Sequence,HTTP,HTTP/1.1 200 OK\r\n,40 Sequence,TCP,Connection establish request (SYN): 29536 -> http,1
Sequence,TCP,Connection establish acknowledge (SYN+ACK): http -> 29536,1 Sequence,HTTP,GET /register.php HTTP/1.1\r\n,1 Sequence,HTTP,GET /style/face.css HTTP/1.1\r\n,1 Sequence,HTTP,GET /js/common.js HTTP/1.1\r\n,1
Sequence,HTTP,GET /js/ac_runactivecontent.js HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-reg_introimg-l-brd.jpg HTTP/1.1\r\n,1 Sequence,TCP,Connection establish request (SYN): 29537 -> http,1 Sequence,TCP,Connection establish acknowledge (SYN+ACK): http -> 29537,1
Sequence,TCP,Connection establish request (SYN): 29538 -> http,1 Sequence,TCP,Connection establish acknowledge (SYN+ACK): http -> 29538,1 Sequence,HTTP,GET /images/tbl-mn_uzor-left-bottom.gif HTTP/1.1\r\n,1
Sequence,HTTP,GET /images/tbl-reg_uzor-left-top.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /counter?id=1097265;t=55;js=13;r=;j=true;s=1280*768;d=32;rand=0.213420547460749 HTTP/1.1\r\n,1 Sequence,TCP,Connection finish (FIN): http -> 29538,1
Sequence,TCP,Connection finish (FIN): 29538 -> http,1 Sequence,HTTP,GET /images/tbl-reg_menu-top.jpg HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/users-arrow.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_menu-
top-right.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/users-arrow-org.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_news-active-r.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_info-top.jpg HTTP/1.1\r\n,1
Sequence,HTTP,GET /images/tbl-mn_reg-1.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-reg_intbl-corner-top-left.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-reg_intbl-corner-top-right.gif HTTP/1.1\r\n,1
Sequence,HTTP,GET /images/tbl-mn_btn-step2.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-reg_intbl-corner-bottom-left.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-reg_intbl-corner-bottom-right.gif HTTP/1.1\r\n,1
Sequence,HTTP,GET /images/tbl-mn_menu-bottom-right.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_news-sep-l.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_news-sep-r.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-reg_introimg-
r-brd.jpg HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_uzor-right-top.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_uzor-right-bottom.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_brd-left2.jpg HTTP/1.1\r\n,1
Sequence,HTTP,GET /images/tbl-mn_bg.jpg HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_menu-bg.jpg HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_news-active-l.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_news-
active-c.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_menu-bottom.jpg HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_info-bg.jpg HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-reg_intbl-top.gif HTTP/1.1\r\n,1
Sequence,HTTP,GET /images/tbl-reg_intbl-left.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-reg_intbl-bg.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-usi_bg-light.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-reg_intbl-
right.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-reg_intbl-bottom.gif HTTP/1.1\r\n,1 Sequence,HTTP,GET /images/tbl-mn_brd-right2.jpg HTTP/1.1\r\n,1
Итого 3 одновременных tcp соединения.
Общее время загрузки страницы - 1.912 sec.
Нужно заметить что время получения одного обьекта с апача и с nginx приблизительно относительно одинаковы. Разница может составлять 0,005 секунды как в ту так и в другую стороны, что вполне можно списать на погрешность изменрений.
Отсюда вопрос: - кто и исходя из каких данных принимает решение сколько одновременных tcp cоединений к серверу хочется открывать ?
-- liberation loophole will make it clear
|