http_load使用の詳細

2654 ワード

テキストリンク:https://www.cnblogs.com/shijingjing07/p/6539179.html
1.http_とはload
http_loadはLinuxプラットフォームに基づくwebサーバ性能テストツールで、webサーバのスループットと負荷、webページの性能をテストするために使用されます.
2.http_loadのインストール
1)ダウンロードアドレスwget http://www.acme.com/software/http_load/http_load-12mar2006.tar.gz)インストールtar xzvfhttp_load-12mar2006.tar.gz make make installフォルダ内容は以下の通り

image.png
 
3.http_loadの使用
1)作成ファイルvi urlsは、urlsなどの測定するサーバドメイン名またはIPアドレスに書き込まれるhttp://www.baidu.com/ 192.168.0.1のようなものでも測定できます
2)使用例./http_load -rate 5 -seconds 10 urls
-parallel   -p :           。
-fetches   -f :          
-rate   -p :          
-seconds  -s :          

実行結果:
           10    ,      5。
49 fetches, 2 max parallel, 289884 bytes, in 10.0148 seconds
5916 mean bytes/connection
4.89274 fetches/sec, 28945.5 bytes/sec
msecs/connect: 28.8932 mean, 44.243 max, 24.488 min
msecs/first-response: 63.5362 mean, 81.624 max, 57.803 min
HTTP response codes:
code 200 -- 49

結果分析:
1.49 fetches, 2 max parallel, 289884 bytes, in 10.0148 seconds
            49   ,         2,        289884bytes,      10.0148 
2.5916 mean bytes/connection
              289884/49=5916
3.4.89274 fetches/sec, 28945.5 bytes/sec
          4.89274,        28945.5 bytes/sec
4.msecs/connect: 28.8932 mean, 44.243 max, 24.488 min
             28.8932 msecs,       44.243 msecs,       24.488 msecs
5.msecs/first-response: 63.5362 mean, 81.624 max, 57.803 min 
6、HTTP response codes: code 200 -- 49
           ,  403     ,               。
    :  ,            fetches/sec、msecs/connect
               
Qpt-        response time,         。
              。                    ,          cpu、men    ,      

4.よくあるエラー
1)byte count wrong
http_load               URL    (    )    ,        byte count wrong

2)too many open files
     open files  ,ulimit -n   open files   

3)        (    >600   )
       buf   http_load.c

4)Cannot assign requested address
          ,                ,     TIME_WAIT,            ,             ,            ,
 sysctl.conf  :
net.ipv4.tcp_tw_reuse = 1       。   TIME-WAIT sockets      TCP  ,   0,    ;
net.ipv4.tcp_timestamps=1     TCP      ,      0,           
net.ipv4.tcp_tw_recycle=1     TCP   TIME-WAIT sockets