The Joy of Turck MMCache

    Harry Fuecks

    It’s been said before but Turck MMCache is a great piece of software. As it says on the cover;

    Turck MMCache is a free open source PHP accelerator, optimizer, encoder and dynamic content cache for PHP. It increases performance of PHP scripts by caching them in compiled state, so that the overhead of compiling is almost completely eliminated. Also it uses some optimizations to speed up execution of PHP scripts. Turck MMCache typically reduces server load and increases the speed of your PHP code by 1-10 times.

    Last time I looked at it was back in the beginning of 2003, when I needed an accelerator for a Windows server running PHP. Since then it’s come on along way and now offers what it calls a “dynamic content cache” which is what got me interested again.

    Installation is a breeze on Linux and even easier on Windows – the author bothers to take the time to compile Windows dlls for just about every PHP version back to 4.1.0, making this about the only Open Source PHP accelerator you can run easily on under Windows, without needing to drag out VC++.

    The dynamic content cache provides an API for storing data in memory – you could drop HTML output, captured with PHP’s output control functions or even use it for object persistence. PHP’s Shared Memory API does similar but to be useful you need alot of “glue” code to handle things like dynamically growing the shared memory block. The MMCache API takes care of all that and simply fills up space to either PHP’s limit or some value you specify in php.ini. Prevayler here we come…

    Overall, something to harass your host for… [of course you’re not going to get the shared memory access on a shared host]