MovableType4.01をFastCGIで高速化?

まったく納得できていませんが動いているようです。自分用のメモとして。
環境
openSUSE10.3(10.2からのバージョンアップ)
apache2.2.4
apache2-mod_fcgid2.1-19
perl5.8.8

参考先
Ogawa::Memoranda
De Rerum Natura
まずはMT-Dispatch(プラグイン)をDL Download version 1.4.

/mt/plugins/にアップ

Perlモジュールの追加
FCGI
FCGI::ProcManager
Sub::OverrideFile
File::Slurp

# perl -MCPAN -e shell

cpan shell -- CPAN exploration and modules installation (v1.7602)
ReadLine support enabled

cpan> install FCGI

省略
        
/usr/bin/make install UNINST=1 -- OK

cpan> install FCGI::ProcManager

省略
 
/usr/bin/make install UNINST=1 -- OK

cpan> install Sub::OverrideFile

省略

/usr/bin/make install UNINST=1 -- OK
 
cpan> install File::Slurp

省略

/usr/bin/make install UNINST=1 -- OK

cpan> quit
/mt/以下のファイル拡張子をcgiからfcgiに変更
mt.fcgi
mt-comments.fcgi
mt-tb.fcgi
mt-search.fcgi (エラーが出るようなら#コメントアウト)
mt-view.fcgi

/mt/mt-config.cgiに以下を追記(CGIPathの下に挿入)
AdminScript mt.fcgi
CommentScript mt-comments.fcgi
TrackbackScript mt-tb.fcgi
SearchScript mt-search.fcgi (エラーが出るようなら#コメントアウト)
ViewScript mt-view.fcgi
LaunchBackgroundTasks 1

/etc/apache2/conf.d/mod-fcgid.conf

mod-fcgid.conf

  1. ################################################################################

  2. ##

  3. ## Sample config for apache2_mod-fcgid
  4. ##

  5. ## All lines, that are commented out, reflect the default values.

  6. ##


  7. <IfModule fcgid_module>


  8. ##

  9. ## An idle fastcgi application will be terminated after IdleTimeout seconds.

  10. ##


  11. IdleTimeout 300


  12. ##

  13. ## The scan interval for idle fastcgi applications in seconds.

  14. ##


  15. IdleScanInterval 120


  16. ##

  17. ## a fastcgi application will be terminated if handing a single request longer

  18. ## than busy timeout. Value in seconds.

  19. ##


  20. BusyTimeout 300


  21. ##

  22. ## The scan interval for busy timeout fastcgi applications. Value in seconds.

  23. ##


  24. BusyScanInterval 120


  25. ##

  26. ## The scan interval for exit pending fastcgi applications. fastcgi applications

  27. ## will be terminated within this scanning. Value in seconds.

  28. ##


  29. ErrorScanInterval 3


  30. ##

  31. ## The scan interval for zombie process. Value in seconds.

  32. ##


  33. ZombieScanInterval 3


  34. ##

  35. ##

  36. ## A fastcgi application will be terminated if lifetime expired, even no error

  37. ## is detected. Value in seconds.

  38. ##


  39. ProcessLifeTime 3600


  40. ##

  41. ## The directory to put the UNIX domain socket. (UNIX only)

  42. ##


  43. SocketPath /var/lib/apache2/fcgid/


  44. ##

  45. ## The spawn-speed control score up water limit. Score increases while a process

  46. ## is spawned or terminated, and decreases as time progresses; while the score is

  47. ## higher than SpawnScoreUpLimit, the spawning will be held for a while. The

  48. ## higher this number is, the higher speed of the spawning can be.

  49. ##

  50. #SpawnScoreUpLimit n (10)


  51. ##

  52. ## The weight of spawning. This weight will be plused to the spawn-control

  53. ## score on every spawn. The higher this number is, the lower speed of spawning

  54. ## can be.

  55. ##

  56. #SpawnScore n (1)


  57. ##

  58. ## The weight of termination. This weight will be plused to the score while

  59. ## fastcgi process terminates. The higher this number is, the lower speed of

  60. ## spawning can be.

  61. ##

  62. #TerminationScore n (2)


  63. ##

  64. ## The max count of total fastcgi process count.

  65. ##

  66. #MaxProcessCount n (1000)


  67. ##

  68. ## The maximum number of fastcgi application instances allowed to run for any

  69. ## one fastcgi application.

  70. ##

  71. #DefaultMaxClassProcessCount n (100)


  72. ##

  73. ## The default environment variables before a fastcgi application is spawned.

  74. ## You can set this configuration more than once.

  75. ##

  76. #DefaultInitEnv env_name env_value


  77. ##

  78. ## The connect timeout to a fastcgi application. Value in seconds.

  79. ##

  80. ## Default value: 2

  81. ##

  82. #IPCConnectTimeout 10


  83. IPCConnectTimeout 60


  84. ##

  85. ## The communication timeout to a fastcgi application. Please increase this

  86. ## value if your CGI have a slow initialization or slow respond. Value in

  87. ## seconds.

  88. ##

  89. ## Default value: 5

  90. ##


  91. IPCCommTimeout 40


  92. ##

  93. ## CGI output cache buffer size. Value in kilobytes.

  94. ##


  95. OutputBufferSize 64


  96. #############################################

  97. #▼ De Rerum Natura: MT-Dispatch-20071025 ▼#

  98. #############################################


  99. DefaultInitEnv MT_HOME /home/users/puplic_html/cgi-bin/mt/

  100. DefaultInitEnv PERL_FCGI_Max_REQUESTS 250

  101. DefaultInitEnv PERL_FCGI_CHILDREN 4

  102. DefaultInitEnv PERL_FCGI_LOG /var/log/apache2/mt-dispatch.log


  103. <Directory "/home/users/puplic_html/cgi-bin/mt">

  104. AddHandler fcgid-script .fcgi

  105. Options ExecCGI

  106. allow from all

  107. FCGIWrapper /home/users/public_html/cgi-bin/mt/plugins/MT-Dispatch/mt-dispatch.fcgi .fcgi

  108. </Directory>


  109. #############################################

  110. #▲ De Rerum Natura: MT-Dispatch-20071025 ▲#

  111. #############################################


  112. ##

  113. ##

  114. ## PHP via FastCGI

  115. ##

  116. ## uncomment the following line if you want to handle php via mod_fcgid

  117. ##

  118. #<FilesMatch "\.php$">

  119. # AddHandler fcgid-script .php

  120. # FCGIWrapper /srv/www/cgi-bin/php5 .php

  121. # Options +ExecCGI

  122. #</FilesMatch>

  123. ##

  124. </IfModule>

  125. # End of <IfModule fcgid_module>


  126. ##

  127. ################################################################################

Apacheを再起動
# /etc/init.d/apache2 restart

エントリー編集で3秒ほどの保存時間が体感半分にはなっているようですが、apacheのmod_fcgidがすっきりしていません。 あくまでも参考として