忍者ブログ

Eljudnir ~エルヴィドネル

徒然なるままに、日暮らし、PCに向かひて、心に移りゆくよしなし事を、そこはかとなく書きつくれば、あやしうこそものぐるほしけれ。
×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

Apache Bench を使って性能測定していたのだが、Connection Times の Connect, Processing, Waiting の和が Total と一致しないので、不思議に思って調べた。しかし、日本語サイトでは一様に「接続時間、処理時間、待ち時間です」というようなことしか書かれておらず、stackoverflowにそれらしき記述が見つかっただけだった。当たり前のこと過ぎて書いてないのかもしれないが、私には分かりにくかったのでメモしておく。



調べた末の私の理解は、下図の通りである。※図中の送信・受信は、サーバ主体で記述


Apache Bench Connection Times

参照したのは以下のサイトで、最も参考とした部分を引用する。
performance - Definition of Connect, Processing, Waiting in apache bench - Stack Overflow


(以下、引用)
By looking at the source code we find these timing points:
apr_time_t start,           /* Start of connection */
           connect,         /* Connected, start writing */
           endwrite,        /* Request written */
           beginread,       /* First byte of input */
           done;            /* Connection closed */
And when request is done some timings are stored as:
        s->starttime = c->start;
        s->ctime     = ap_max(0, c->connect - c->start);
        s->time      = ap_max(0, c->done - c->start);
        s->waittime  = ap_max(0, c->beginread - c->endwrite);
And the 'Processing time' is later calculated as
s->time - s->ctime;
So if we translate this to a timeline:
t1: Start of connection
t2: Connected, start writing
t3: Request written
t4: First byte of input
t5: Connection closed
Then the definitions would be:
Connect:      t1-t2   Most typically the network latency
Processing:   t2-t5   Time to receive full response after connection was opened
Waiting:      t3-t4   Time-to-first-byte after the request was sent
Total time:   t1-t5

ただ、英語を正しく理解できているかははっきり言って自信がないので、もし間違いに気付いた方がいたらご指摘ください。修正 or 削除します。

あと、検索方法が下手クソで解説記事を見つけていないだけかもしれないので、もしご存知の方がいたら教えていただけると喜びます。

以上です。

PR
もくじ
[Apache Bench:Connection Times の意味]
140字小説が面白い
  (2024/05/18)
パソコン関連  (2016/10/20)
小学生は大変
プロフィール
管理人:
ヘラ
Twitter:
自己紹介:
一言
お気軽にどうぞー。
カレンダー
04 2024/05 06
S M T W T F S
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
タグ
クリックすると、関連記事の一覧が表示されます。
ブログ内検索
Copyright © Eljudnir ~エルヴィドネル All Rights Reserved.
Material by tudu*uzu
忍者ブログ [PR]