Movable Type Speed Improvement

Its been awhile since I've tinkered around with MovableType, but tonight I decided to try and make some speed improvements to my setup.

I focused on FastCGI, Memcached, and Apache.

FastCGI

As of MTOS 4.3, FastCGI support is now built-in, but I still had only mt.cgi running as a FastCGI script. I updated my Apache2 configuration to include mt-view.cgi, mt-comments.cgi, and mt-search.cgi as fcgid-scripts:

<Directory "/usr/lib/cgi-bin">
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
    AddHandler CGI-Script .cgi
    <FilesMatch "^mt(?:-(?:comments|search|view))?\.cgi$">
        SetHandler fcgid-script
    </FilesMatch>
</Directory>

I also updated the mod_fcgid configuration:

<IfModule mod_fcgid.c>
  AddHandler    fcgid-script .fcgi
  IPCConnectTimeout 20
  ProcessLifeTime 14400
  IdleTimeout 3600
  IdleScanInterval 600
  DefaultMinClassProcessCount 0
  SpawnScoreUpLimit 20
  MaxRequestsPerProcess 499
</IfModule>

and mt-config.cgi:

FastCGIMaxTime 7200
FastCGIMaxRequests 400

Apache

I disabled some unnecessary modules, and increased the cache size of mod-spamhaus (an awesome module which helps to block comment spammers).

Memcached

I once again installed Cache::Memcached::Fast via CPAN and enabled it in mt-config.cgi.

NGINX

I've also managed to speed up MovableType admin pages a little by setting some HTTP headers with NGINX:

    location ^~ /s/mt/ {
        if ( $request_uri ~* "\.(jpg|gif|png)$") {
            add_header    Cache-Control  public;
            expires 24h;
        }
        alias /usr/share/movabletype/static/;
    }
By Albert on February 27, 2010 10:39 PM

Categories: