2007年08月03日

おすすめメルマガ「Linuxサーバー管理者経験を作ろう!!」

●Linuxサーバー管理者経験を作ろう!!


 http://blog.mag2.com/m/log/0000093813/



 色々な話の内容が盛りだくさんです。




オススメ雑誌

 何も言いません!買いなさい(^^)/わーい(嬉しい顔)手(チョキ)

 

LinuxWorld メモリアルDVDブック [2001-2007]

出版社:アイ・ディ・ジー・ジャパン
価格:¥2,194



※会社費用で購入し、DVDだけもらう、作戦も
 いいかも。わーい(嬉しい顔)
 
posted by 南極のペンギン at 14:26| Comment(17) | TrackBack(8) | 役立つURL | このブログの読者になる | 更新情報をチェックする

2007年07月04日

ウォームアップ3日目・・abコマンド(3)

ブランクの長さに愕然とする・・・

北村君とバトル日は、いつのことやら・・。

=================================

大:あのー。

竹:はい?

大:abのコマンドうってるんですけど、
  どんな事をやってるんですか?

竹:あ、ごめん、ごめん。


  ab -n 100 -c 10 http://192.168.1.14/


  このコマンドの説明をしなきゃね。


  ab:ベンチマークのプログラムのことです。

  -n:httpリクエストの回数(総合計)です。
    ここでは、100回(個)のhttpリクエストを、
    サーバーに送信するわけです。

  -c:同時に発行するhttpリクエストの数です。
    ここでは、一度に10個のリクエストを行いました。


  1度に10個のリクエストを送信し、
  合計100個のhttpリクエストを送った。


  ということは、100を10で割るから、
  10度リクエストしたわけですね。

  10かける10=100 です。

大:なるほど。

  今度、manで調べてみます。

竹:当然、普通は、
  ネットワーク経由で、
  サーバーのIPアドレスにabするんだけど、
  ローカルでの記録もデータとして
  とります。

[root@bind1 ~]# ab -n 100 -c 10 http://192.168.1.14/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.1.14 (be patient).....done


Server Software: Apache/2.2.3
Server Hostname: 192.168.1.14
Server Port: 80

Document Path: /
Document Length: 3956 bytes

Concurrency Level: 10
Time taken for tests: 0.123563 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Non-2xx responses: 102
Total transferred: 423606 bytes
HTML transferred: 403512 bytes
Requests per second: 809.30 [#/sec] (mean)
Time per request: 12.356 [ms] (mean)
Time per request: 1.236 [ms] (mean, across all concurrent requests)
Transfer rate: 3342.42 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 2.1 1 7
Processing: 2 7 2.1 8 15
Waiting: 0 3 2.3 3 13
Total: 5 9 2.3 10 16

Percentage of the requests served within a certain time (ms)
50% 10
66% 10
75% 11
80% 11
90% 12
95% 14
98% 16
99% 16
100% 16 (longest request)



大:急に、すごい速くなる時
  ありますね。

竹:これを常時出せない限り、
  北山君に圧勝できないからね。

大:そういう闘いなんですか、これわーい(嬉しい顔)


竹:リクエストを、もっと増やして、
  という
  A氏とO氏のリクエストが来てますわーい(嬉しい顔)

  
  ちょっと数値を上げてみましょう。


大:おっ・・・。画面が微妙に遅く・・・。

[root@bind1 ~]# ab -n 1000 -c 10 http://192.168.1.14/



竹:言うほど、変わらないねぇー。

[root@bind1 ~]# ab -n 1000 -c 10 http://192.168.1.14/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.1.14 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests


Server Software: Apache/2.2.3
Server Hostname: 192.168.1.14
Server Port: 80

Document Path: /
Document Length: 3956 bytes

Concurrency Level: 10
Time taken for tests: 1.393591 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Non-2xx responses: 1001
Total transferred: 4157153 bytes
HTML transferred: 3959956 bytes
Requests per second: 717.57 [#/sec] (mean)
Time per request: 13.936 [ms] (mean)
Time per request: 1.394 [ms] (mean, across all concurrent requests)
Transfer rate: 2912.62 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 2 2.9 1 36
Processing: 3 10 6.2 9 83
Waiting: 0 4 5.5 3 80
Total: 3 12 7.3 11 87

Percentage of the requests served within a certain time (ms)
50% 11
66% 12
75% 13
80% 13
90% 15
95% 21
98% 39
99% 53
100% 87 (longest request)


大:私がabしてもいいですか?



[root@bind1 ~]# ab -n 10000 -c 100 http://192.168.1.14/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.1.14 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Finished 10000 requests


Server Software: Apache/2.2.3
Server Hostname: 192.168.1.14
Server Port: 80

Document Path: /
Document Length: 3956 bytes

Concurrency Level: 100
Time taken for tests: 18.356872 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Non-2xx responses: 10074
Total transferred: 41837322 bytes
HTML transferred: 39852744 bytes
Requests per second: 544.76 [#/sec] (mean)
Time per request: 183.569 [ms] (mean)
Time per request: 1.836 [ms] (mean, across all concurrent requests)
Transfer rate: 2225.65 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 18 22.6 12 244
Processing: 7 162 89.0 120 1101
Waiting: 0 126 95.6 93 669
Total: 7 180 87.4 142 1104

Percentage of the requests served within a certain time (ms)
50% 142
66% 170
75% 215
80% 288
90% 323
95% 346
98% 377
99% 400
100% 1104 (longest request)


竹:おっ!遅くなってるね。

  じゃあ、httpd.confをいじるかな、

  そろそろ・・・。


つづく・・・・・・・・・・。手(チョキ)  

posted by 南極のペンギン at 23:47| Comment(0) | TrackBack(0) | abコマンド | このブログの読者になる | 更新情報をチェックする

2007年07月02日

ウォームアップ2日目・・abコマンド(2)

竹:で、大崎さんも入ることになりました。

  研修の一環らしいです。

大:ホントですか?

  あっちで、笑ってますけど・・・。

竹:まあ、いきなり「オン・ザ・ジョブ」より
  いいと思うよ。

  じゃあ、始めます。

  今日は、
  連続で、3回コマンドをうつと
  どうなるか、とか、やりましょう。

  回数やリクエスト数も
  増やしていきますね。

大:はい。

  では、さっそく。



@1回目

[root@bind1 ~]# ab -n 100 -c 10 http://192.168.1.14/

This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.1.14 (be patient).....done


Server Software: Apache/2.2.3
Server Hostname: 192.168.1.14
Server Port: 80

Document Path: /
Document Length: 3956 bytes

Concurrency Level: 10
Time taken for tests: 0.217954 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Non-2xx responses: 100
Total transferred: 415300 bytes
HTML transferred: 395600 bytes
Requests per second: 458.81 [#/sec] (mean)
Time per request: 21.795 [ms] (mean)
Time per request: 2.180 [ms] (mean, across all concurrent requests)
Transfer rate: 1858.19 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 2.6 0 15
Processing: 3 19 48.6 3 205
Waiting: 2 10 21.1 3 86
Total: 3 20 50.3 3 210

Percentage of the requests served within a certain time (ms)
50% 3
66% 3
75% 4
80% 4
90% 90
95% 207
98% 209
99% 210
100% 210 (longest request)

A2回目
[root@bind1 ~]# ab -n 100 -c 10 http://192.168.1.14/

This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.1.14 (be patient).....done


Server Software: Apache/2.2.3
Server Hostname: 192.168.1.14
Server Port: 80

Document Path: /
Document Length: 3956 bytes

Concurrency Level: 10
Time taken for tests: 0.371554 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Non-2xx responses: 100
Total transferred: 415300 bytes
HTML transferred: 395600 bytes
Requests per second: 269.14 [#/sec] (mean)
Time per request: 37.155 [ms] (mean)
Time per request: 3.716 [ms] (mean, across all concurrent requests)
Transfer rate: 1090.02 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 2 3.0 0 12
Processing: 4 27 6.7 28 48
Waiting: 0 20 6.3 21 37
Total: 8 29 7.8 30 57

Percentage of the requests served within a certain time (ms)
50% 30
66% 32
75% 33
80% 35
90% 38
95% 43
98% 52
99% 57
100% 57 (longest request)

B3回目
[root@bind1 ~]# ab -n 100 -c 10 http://192.168.1.14/

This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.1.14 (be patient).....done


Server Software: Apache/2.2.3
Server Hostname: 192.168.1.14
Server Port: 80

Document Path: /
Document Length: 3956 bytes

Concurrency Level: 10
Time taken for tests: 0.138588 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Non-2xx responses: 100
Total transferred: 415300 bytes
HTML transferred: 395600 bytes
Requests per second: 721.56 [#/sec] (mean)
Time per request: 13.859 [ms] (mean)
Time per request: 1.386 [ms] (mean, across all concurrent requests)
Transfer rate: 2922.33 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 1.8 1 7
Processing: 2 10 3.3 11 20
Waiting: 0 4 2.8 4 16
Total: 3 12 3.8 12 23

Percentage of the requests served within a certain time (ms)
50% 12
66% 14
75% 15
80% 15
90% 17
95% 20
98% 22
99% 23
100% 23 (longest request)




比較
@Time per request: 21.795 [ms] (mean)

ATime per request: 37.155 [ms] (mean)

BTime per request: 13.859 [ms] (mean)


竹:意味分からん・・・。

  ひょっとして、
  はったコネクションを、
  すぐに利用すると、
  レスポンスが上がるのかも・・・。



  あれー、でも、
  たまに、異常に増える時あるなぁー。

(例)
Time per request: 41.532 [ms] (mean)



竹:あれ、下がらなくなったぞ。


(コマンドを、繰り返し打ち続ける)

竹:まさか、
  プロセスだらけになってたりして・・・。

  うわっ!



[root@bind1 ~]# netstat -an | grep 80

(多すぎて、省略)

tcp 0 0 ::ffff:192.168.1.14:80 ::ffff:192.168.1.14:50799 TIME_WAIT
tcp 0 0 ::ffff:192.168.1.14:80 ::ffff:192.168.1.14:50543 TIME_WAIT
tcp 0 0 ::ffff:192.168.1.14:80 ::ffff:192.168.1.14:50287 TIME_WAIT
tcp 0 0 ::ffff:192.168.1.14:80 ::ffff:192.168.1.14:50031 TIME_WAIT
tcp 0 0 ::ffff:192.168.1.14:80 ::ffff:192.168.1.14:49775 TIME_WAIT


竹:なるほど。

  しかし、こんなに多くなるのか・・・。


  http1.1 だから・・・、か。

  うーーん。

  しばらく、放っておくと元に戻る・・か。
  (下記参照)


[root@bind1 ~]# netstat -an | grep 80
tcp 0 0 127.0.0.1:57801 0.0.0.0:* LISTEN
tcp 0 0 :::80 :::* LISTEN
unix 3 [ ] STREAM CONNECTED 6480
unix 2 [ ] DGRAM 4380




■参考書籍

Apacheクックブック―Webサーバ管理者のためのレシピ集

価格:\2,940(税込)
出版社:オライリージャパン


posted by 南極のペンギン at 20:22| Comment(1) | TrackBack(0) | abコマンド | このブログの読者になる | 更新情報をチェックする

ウォームアップ1日目・・abコマンド

プロジェクトRから2年が、経った。

あれから、Apacheから、どんどん
離れる日々が続き、
最近では、
abコマンドすら忘れてしまった・・・。



もう1度・・・・
  再び・・・・・・
    Apache最速を目指す・・・!

●●●●●●●●●●●●●●●●●

勤務時間は、とっくに過ぎた、PM22:00。

大阪の、
あるビルの1室に1人。

abコマンドを、ひたすら叩く男が・・・・




竹:うーーん、すっかり忘れてたよ。

  abコマンド。

  まあ、これくらいなら、すぐ
  思い出すな。



■bind1(12.168.1.14/24)
 OS:Fedora Core 6
 
 ※備考:Vmware上で動作


[root@bind1 ~]# ab -n 100 -c 10 http://192.168.1.14/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.1.14 (be patient).....done


Server Software: Apache/2.2.3
Server Hostname: 192.168.1.14
Server Port: 80

Document Path: /
Document Length: 3956 bytes

Concurrency Level: 10
Time taken for tests: 0.176327 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Non-2xx responses: 100
Total transferred: 415300 bytes
HTML transferred: 395600 bytes
Requests per second: 567.13 [#/sec] (mean)
Time per request: 17.633 [ms] (mean)
Time per request: 1.763 [ms] (mean, across all concurrent requests)
Transfer rate: 2296.87 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.5 0 3
Processing: 8 15 17.0 13 172
Waiting: 8 15 16.9 12 171
Total: 8 16 17.3 13 174

Percentage of the requests served within a certain time (ms)
50% 13
66% 13
75% 13
80% 14
90% 25
95% 34
98% 44
99% 174
100% 174 (longest request)


■bind1(192.168.1.14/24)から
 post1(192.168.1.13/24)へ


[root@bind1 ~]# ab -n 100 -c 10 http://192.168.1.13/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.1.13 (be patient).....done


Server Software: Apache/2.2.3
Server Hostname: 192.168.1.13
Server Port: 80

Document Path: /
Document Length: 3956 bytes

Concurrency Level: 10
Time taken for tests: 0.327772 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Non-2xx responses: 100
Total transferred: 415300 bytes
HTML transferred: 395600 bytes
Requests per second: 305.09 [#/sec] (mean)
Time per request: 32.777 [ms] (mean)
Time per request: 3.278 [ms] (mean, across all concurrent requests)
Transfer rate: 1235.62 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.8 0 6
Processing: 10 30 29.7 27 322
Waiting: 5 27 29.8 25 320
Total: 14 30 30.2 28 327

Percentage of the requests served within a certain time (ms)
50% 28
66% 29
75% 29
80% 29
90% 32
95% 35
98% 48
99% 327
100% 327 (longest request)


竹:うん。

  予想通り、
  ネットワーク経由で、
  abコマンドを使うと
  Time per requestの値は、
  増えてるな。

  当たり前か・・・。


北:おつかれさまでっす。

竹:おう。。

  久しぶり。

  やっと始められそうだよ

  というか、始めてるつもりなんだけど(^^)。

北:明日から、本格的に始めましょうか。

竹:いや、ちょっと待って。

  ブランクでか過ぎ。

北:まあ、バトルは、いつでもいいですよ。

  僕も、ブランクでかかったし。

竹:じゃあ、とりあえず、明日から毎日
  ブログの更新だけ、やるよ。

北:じゃあ、お先に失礼しまっす。手(パー)

竹:おつかれさまぁー。手(パー)




■参考書籍

Apache運用技法

価格:\2,310(税込)
出版社:アスキー



  

posted by 南極のペンギン at 00:43| Comment(1) | TrackBack(0) | abコマンド | このブログの読者になる | 更新情報をチェックする

広告


この広告は60日以上更新がないブログに表示がされております。

以下のいずれかの方法で非表示にすることが可能です。

・記事の投稿、編集をおこなう
・マイブログの【設定】 > 【広告設定】 より、「60日間更新が無い場合」 の 「広告を表示しない」にチェックを入れて保存する。