mod_pagespeedを入れてみた

下記の記事が気になったので、さっそく試してみた次第です。

あなたのサイトも最高2倍速に?!Google純正のサイト高速化モジュール『mod_pagespeed』だと・・・ | IDEA*IDEA

環境

いつも通り下記の環境を使います。
さくらのVPSです。

インストール前に

大したページは無いですが、ベンチを取ってみます。
単なる静的ページです。

% ab -n 100 -c 10 http://hnsta.com/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking hnsta.com (be patient).....done


Server Software:        Apache
Server Hostname:        hnsta.com
Server Port:            80

Document Path:          /
Document Length:        1808 bytes

Concurrency Level:      10
Time taken for tests:   1.509 seconds
Complete requests:      100
Failed requests:        0
Write errors:           0
Total transferred:      198600 bytes
HTML transferred:       180800 bytes
Requests per second:    66.28 [#/sec] (mean)
Time per request:       150.875 [ms] (mean)
Time per request:       15.087 [ms] (mean, across all concurrent requests)
Transfer rate:          128.55 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       27   62  26.2     55     112
Processing:    41   83  26.6     87     132
Waiting:       37   80  26.5     83     130
Total:         76  145  14.9    141     175

Percentage of the requests served within a certain time (ms)
  50%    141
  66%    151
  75%    154
  80%    155
  90%    165
  95%    167
  98%    173
  99%    175
 100%    175 (longest request)

インストール

利用環境は上に書いた通り、CentOSの64-bit環境です。
なので、対応したrpmをダウンロードします。

$ wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_x86_64.rpm

公開鍵も必要なので、ダウンロードします。

$ wget https://dl-ssl.google.com/linux/linux_signing_key.pub

公開鍵をインポートします。

$ sudo rpm --import linux_signing_key.pub 

ではインストールします。

$ sudo yum localinstall mod-pagespeed-beta_current_x86_64.rpm

初期設定で動かす

とりあえず、そのまま動かしてみます。
apacheを再起動します。

$ sudo apachectl stop
$ sudo apachectl start

で、ベンチ取ってみます。
…完走ならず。あれ?

% ab -n 100 -c 10 http://hnsta.com/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking hnsta.com (be patient)...apr_poll: The timeout specified has expired (70007)
Total of 92 requests completed

うーーーーーん。なにか失敗したかな。
ということで、次回に続きます(ホントかな?)

追記(2010/11/04 23:36)

キャッシュディレクトリのパーミッションが間違っていました(汗)
apacheユーザ以外で動かしている人は要注意です。

ということで、ベンチ取ってみました。

% ab -n 100 -c 10 http://hnsta.com/        
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking hnsta.com (be patient).....done


Server Software:        Apache
Server Hostname:        hnsta.com
Server Port:            80

Document Path:          /
Document Length:        1856 bytes

Concurrency Level:      10
Time taken for tests:   1.564 seconds
Complete requests:      100
Failed requests:        0
Write errors:           0
Total transferred:      208700 bytes
HTML transferred:       185600 bytes
Requests per second:    63.96 [#/sec] (mean)
Time per request:       156.351 [ms] (mean)
Time per request:       15.635 [ms] (mean, across all concurrent requests)
Transfer rate:          130.35 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       27   60  25.9     55     108
Processing:    44   90  27.8     90     152
Waiting:       40   85  27.9     86     150
Total:         70  150  19.6    151     231

Percentage of the requests served within a certain time (ms)
  50%    151
  66%    155
  75%    157
  80%    157
  90%    165
  95%    176
  98%    217
  99%    231
 100%    231 (longest request)
  • mod_pagespeed 適用前
Requests per second:    66.28 [#/sec] (mean)
Time per request:       150.875 [ms] (mean)
  • mod_pagespeed 適用後
Requests per second:    63.96 [#/sec] (mean)
Time per request:       156.351 [ms] (mean)

えー。パフォーマンスダウン(笑)
やっぱり静的ページじゃ、フィルタリングの処理の分、遅くなりますよね…
動的だったらキャッシュも効いてくるんでしょう。