The Joy of Turck MMCache

Tweet

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]

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

  • http://www.sample.com Widow Maker

    Didn’t know about this before. Looks really cool don’t it ?

    Thanks Harry, harass my host I will :D

  • http://www.sitepoint.com/ mmj

    Good post. A PHP bytecode cache like MMCache is almost mandatory given the extent to which they improve performance.

  • http://www.casualcode.com eXplosive

    I have been using Turck MMCache for quite sometime. It is a great product and if you

  • andreas

    The only developer Dimitri, works for Zend now, he works on PHP, the new SOAP-extension…

    Have a look at: http://sourceforge.net/forum/forum.php?thread_id=986362&forum_id=236228

  • http://blog.casey-sweat.us/ sweatje

    Has anyone else run across issues where a script crashes, you disable the accelerator, and then they run fine? Perhaps it is just my style of programming, but I seem to have run into this issue with several accelerators.

  • http://mgaps.highsidecafe.com BDKR

    I couldn’t agree with you more about the usefullness of Turk. It’s shared memory mechanism (facilitating object persistence among other things) is simply the best. The only thing it needs to do now is acquire the ability to store a database connection. It would be nice to not have the overhead of database connection from script call to script call.

    Cheers…

  • j

    uhm. why not just use *_pconnect?