トップ «前の日(08-19) 最新 次の日(08-21)» 追記

おいぬま日報(不定期)

カテゴリ | 技術情報まとめWiki | 検索エンジンから来た人向け | RSS

2003年
8月
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



2004-08-20

@ [admin] 障害情報

どうも 8/20 4:20頃から Apache が落ちていたため、Webページ全般が見えなくなっていました。すみません。原因は mod_python を有効にすると、Apacheのリクエストを処理するプロセスが死んでしまっていたからのようです。

@ [fx] 今日のFX

+17,327円。しかし含み損はまだまだ続く。

  • USD/JPY B 109.60->109.65*2 384円
  • USD/JPY B 109.05->109.33*2 4600円
  • EUR/USD S 1.2377->1.2335*2 8187円
  • EUR/USD S 1.2354->1.2344*1 568円
  • EUR/USD S 1.2373->1.2352*2 3588円
本日のツッコミ(全1件) [ツッコミを入れる]

# ADSL1M [今朝、見れなくてガッカリしました。治ってよかったです。 今メールしておきました。]


2006-08-20

@ [apache] mod_cache,mod_disk_cacheで高速化

Apache 2.2からはそれなりに安心して使えるようなので、この日記を動かしているmod_proxyサーバに試しにインストールしてみました。staticに組み込むのもどうかと思ったのでDSOでコンパイル。

$ export CFLAGS="-O3"
$ ./configure --prefix=/usr/local/httpd_proxy \
 --with-mpm=worker \
 --enable-shared \
 --enable-so \
 --disable-asis \
 --disable-cgid \
 --disable-proxy-connect \
 --disable-proxy-ftp \
 --disable-proxy-ajp \
 --enable-modules='rewrite action vhost-alias proxy proxy_balancer proxy_http' \
 --enable-mods-shared='ssl headers deflate cache disk_cache mem_cache'

ちなみにこの日記のサーバは↓みたいな感じでmod_proxyサーバとmod_fcgidサーバに分散されています。mod_fcgidサーバが生成した動的コンテンツをmod_proxyサーバでキャッシュしてしまおう、というのが今回の狙いです。

diary.lampetty.net ---> +-- mod_fcgidサーバ1
                           |
                           +-- mod_fcgidサーバ2

httpd.confはこんな感じで設定。

LoadModule cache_module modules/mod_cache.so
LoadModule disk_cache_module modules/mod_disk_cache.so
 
<IfModule mod_cache.c>
<IfModule mod_disk_cache.c>
    CacheEnable disk /
    CacheRoot "/var/cache/httpd_proxy/disk_cache"
    CacheMaxFileSize 128000
    CacheMinFileSize 64
    CacheDirLevels 4
    CacheDirLength 5
</IfModule>
</IfModule>

んで、キャッシュの設定する前と後で ab でベンチを取ってみました。以下はキャッシュ設定前。

$ ab -n 50 -c 3 http://diary.lampetty.net/
This is ApacheBench, Version 2.0.41-dev <$Revision: 1.141 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/
 
Benchmarking diary.lampetty.net (be patient).....done
 
 
Server Software:        Apache/2.0.55
Server Hostname:        diary.lampetty.net
Server Port:            80
 
Document Path:          /
Document Length:        23978 bytes
 
Concurrency Level:      3
Time taken for tests:   43.483784 seconds
Complete requests:      50
Failed requests:        1
   (Connect: 0, Length: 1, Exceptions: 0)
Write errors:           0
Non-2xx responses:      1
Total transferred:      1190600 bytes
HTML transferred:       1175994 bytes
Requests per second:    1.15 [#/sec] (mean)
Time per request:       2609.027 [ms] (mean)
Time per request:       869.676 [ms] (mean, across all concurrent requests)
Transfer rate:          26.72 [Kbytes/sec] received
(略)

キャッシュ設定後

$ ab -n 50 -c 3 http://diary.lampetty.net/
This is ApacheBench, Version 2.0.41-dev <$Revision: 1.141 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/
 
Benchmarking diary.lampetty.net (be patient).....done
 
 
Server Software:        Apache/2.0.55
Server Hostname:        diary.lampetty.net
Server Port:            80
 
Document Path:          /
Document Length:        23978 bytes
 
Concurrency Level:      3
Time taken for tests:   2.642869 seconds
Complete requests:      50
Failed requests:        0
Write errors:           0
Total transferred:      1214651 bytes
HTML transferred:       1198900 bytes
Requests per second:    18.92 [#/sec] (mean)
Time per request:       158.572 [ms] (mean)
Time per request:       52.857 [ms] (mean, across all concurrent requests)
Transfer rate:          448.75 [Kbytes/sec] received
(略)

ご覧の通り、43秒→3秒弱なのでです。ディスクにキャッシュするだけでもこんなに速いとは。20%ぐらい速くなればいいかなーなんて控えめに思っていたので本当びっくりです。あとは安定して動いてくれることを祈るのみ。

@ [life] 禁煙

えー、昨年の3月からずっと禁煙しているのですが、気付いたら吸わなかった煙草が10,000を超えました。正直こんなに完璧に卒業できるとは思ってなかったのでちょっと感動。

開始日時 2005年 3月 22日 1時 0分
経過時間 1年 4月 29日 12時間 56分経過
吸わなかった煙草 10330本
浮いた煙草代 139455円
(原価 59762円  たばこ税+消費税 79693円)
延びた寿命 35日 20時間 50分

でも寿命は35日しか増えてないのね。。。

@ [tdiary] ヘッダー/フッターのレイアウト変更

しました。なんかイマイチいいレイアウトが思い浮かばないので迷走中ですが。んで、今さらですがAdSense入れさせてもらいました。このサーバの電気代ぐらい賄わさせてもらえればと。


Bookmark: あんてな | ぶっくまーく | 覚え書き | Project Amateras | ExcelPettyCashBook | FreeStyle Wiki

2002|10|11|
2003|01|02|03|04|05|06|07|08|09|10|11|12|
2004|01|02|03|04|05|06|07|08|09|10|11|12|
2005|01|02|03|04|05|06|07|08|09|10|11|12|
2006|01|02|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|11|12|
2008|01|02|03|04|05|06|07|08|10|11|12|
人気ブログランキング - おいぬま日報(不定期)