Postcards From My Life

Lint I find in my mind's belly-button.
  • EPK
  • Consulting
  • Resume
  • Nerd Herding
  • Talks
  • How to Plan a Website
  • Zend Framework
« Zend Framework Piece by Piece
Update from webcast on Zend_Cache_Frontend_Class »

WinCache – Preliminary tests look REALLY good.

Dear Reader,

UPDATE:
My tests were performed on a Release Candidate of the code. The final code has now been released and Ibuildings has published a benchmark of WinCache 1.0.

Those of you who follow me on twitter know that recently, I tweeted that I had installed Microsoft’s new PHP Opcode Cache, WinCache on a test machine and didn’t see much difference in performance. I then later tweeted that it was probably due to my inexperience in managing II7 and not necessarily a failing of WinCache. In between those two posts, I received 2 messages from people working with Microsoft, the most helpful being from Ruslan Yakushev. If you recognize that name it’s because he writes a lot of good stuff over at iis.net including the getting started guide for WinCache.

Ruslan picked up on the tweet and wrote me a very nice “How can I help” email. It started a conversation that eventually let me to the problem I was having, but I’ve only just now had a chance to finish my rudimentary testing. I can now say that yes, it was my configuration that I had wrong and once I took Ruslan’s advice, I am seeing a tremendous improvement.

Benchmarks suck

Before I go any further I need to say, yes, benchmarks suck. I would never do a PHP on Linux vs PHP on Windows benchmark because there are just too many variables. There is no way to reliably isolate any tests to only compare the performance of the language. However, in this case, I am using PHP on Windows for both tests with a single variable between the tests, WinCache.

I do not pretend that this benchmark will mirror real-world results. It is simply an indicator that WinCache may improve the performance of your application because it did in the case of this one.

Ok, so now we are clear about what we are seeing here. it’s not a guarantee, it’s just a pointer in the right direction. Let me take you through what I did and how I tested.

My Setup

Hardware
3GHX Dell with 2GB of RAM.
OS
Fresh install of Windows 7, fully patched
Other software
  • MySQL
  • Web Platform Installer 2.0RC
  • PHP 5.2.10 (Sorry, it was all that WebPI would install)

The steps I took

  1. I installed Window 7 (Build 7600) fresh on the machine, wiping all other partitions.
  2. I installed all the updates suggested by the Windows Updater
  3. I installed WebPI
  4. I installed MySQL
  5. Using WebPI, I installed Url Re-Writer, WebCache and WordPress
  6. I configured WordPress

Once I could pull WordPress up in a browser on another machine, I used ab on a separate machine, to run a rudimentary test of 1,000 hits against the web site. Then, going by the WinCache guide, I did what I thought would disable WinCache and re-ran the same test. The difference between the initial results were disappointing and not worth mentioning here. Since I had a webcast to prep for, I fired off a quick tweet (mistake) and moved on to my next project. In the back of my mind I knew that even given their past record, Microsoft wouldn’t have released WinCache without it actually working.

This is where Ruslan joined the picture. He emailed me and through our discussion he let me know that the only way to disable WinCache is to actually comment out the dll in the PHP.ini and bounce IIS. I had mistaken wincache.fcenabled for a flag to actually enable or disable all of WinCache.

So, armed with this new knowledge, I disabled WinCache by commenting out the DLL in the PHP.ini and bounced IIS. Here are ab’s results without WinCache.

WITHOUT:
Requests per second:    2.90 [#/sec] (mean)
Time per request:       344.851 [ms] (mean)

Now, the same test run with WinCache enabled.

WITH:
Requests per second:    9.32 [#/sec] (mean)
Time per request:       107.276 [ms] (mean)

So, as you can see, in this non-real-world example setup, the improvement is significant. I need to add this caveat here.

ab was running single concurrency on purpose. I did not specify a -c x because once I do that where do I stop? there was no good concurrency number I could specify?

Conclusion

WinCache does seem to provide a significant improvement in PHP’s performance on Windows/IIS7/FastCGI over running that combination without it. If your application current runs on that stack, I would strongly suggest that you load WinCache on your staging server and run your standard benchmarks to see how your application performs with and without it. DO NOT TAKE MY SIMPLE TEST AS PROOF THAT YOUR APPLICATION WILL BENEFIT FROM WINCACHE! (If you don’t currently have a standard set of benchmarks that you run against your application between releases, you’ve got bigger problems than WinCache will solve…but that’s for another day)

Thanks all around

I want to say thanks to Ruslan because even though it was obviously my fault that the tests weren’t coming out right but he was nice enough to walk me through it and help me find where I was going wrong.

Also, once again, I find myself saying thanks to Microsoft in general for helping advance PHP. I find that as I meet more and more people inside of Microsoft and get to know them, that I am less anxious about their interest in PHP and more encouraged by their presence.

As always, thanks to Ibuildings because they provided the hardware. (believe it or not, I don’t just have machines laying around to play with.) :)

Until Next Time,
I <3 |<
=C=

Tags: microsoft, opcode cache, PHP, Ruslan Yakushev, webpi, wincache, window 7, windows

This entry was posted on Sunday, September 6th, 2009 at 9:56 am and is filed under PHP. You can follow any responses to this entry through the RSS 2.0 feed.Both comments and pings are currently closed.

7 Responses to “WinCache – Preliminary tests look REALLY good.”

  1. Elizabeth M Smith Says:
    September 6th, 2009 at 10:16 am

    Interesting – would be even more interesting to test it vs. APC or $insert_other_PHP_opcode_cache

    But I hate benchmarks too much to do it – someone always has a fit ;)

  2. Cal Evans Says:
    September 6th, 2009 at 12:48 pm

    Hi Liz!

    I think I’ll leave the actual comparisons to those better suited to the task than myself. I am planning techPortal article on “caching roundup” While it won’t compare performance against the various options, it will give a list of the options for caching and their strnegths and weaknesses.

    Thanks for the comment!

    =C=

  3. Cal Evans’ Blog: WinCache - Preliminary tests look REALLY good. | Webs Developer Says:
    September 7th, 2009 at 10:00 am

    [...] Evans has run some initial benchmarks on the newly released Windows PHP cache accelerator (see here) and the results are promising. I [...]

  4. Ruslan Says:
    September 8th, 2009 at 12:55 pm

    There are two switches that can be used to control WinCache:

    wincache.fcenabled – this switch controls the file cache
    wincache.ocenabled – this switch controls the opcode cache

    To completely disable the wincache extension you can just comment it out in the php.ini file (as Cal did), or you can set BOTH of these settings to FALSE.

  5. [Cal Evans] CodeWorks 09 Journal – techPortal Says:
    September 13th, 2009 at 7:21 pm

    [...] WinCache – Preliminary tests look REALLY good. (4) [...]

  6. Paul Says:
    September 26th, 2009 at 8:07 pm

    Thanks for the awesome post, it helped me out a lot.

  7. Cal Evans Says:
    September 27th, 2009 at 7:03 am

    @Paul,

    I’m glad it was useful to you. I’m planning a more complete review of all Opcode caching options for PHP that will be published on http://techportal.ibuildings.com soon.

    =C=

  • Follow me on twitter!

  • My Latest Book


    Avoiding a Goat Rodeo

  • RSS PHP Podcasts

    • MicroPHP vs Complicated PHP – Lately in PHP podcast episode 20
    • SitePoint Podcast #147: The CSS Ninja with Ryan Seddon
    • SitePoint Podcast #146: Patrick Accidentally Installs Chrome
    • Episode 95: Jeff Carouth at ZendCon 2011
    • DPC Radio: Advanced OO Patterns
    • SitePoint Podcast #145: Backbone.js Fundamentals with Addy Osmani
    • SitePoint Podcast #144: Freemium Schmeemium
    • The Debate of Making PHP Faster using a JIT Compiler – Lately in PHP podcast episode 19
    • SitePoint Podcast #143: Happy HTML5 Holidays with Bruce Lawson
    • DPC Radio: Profiling PHP Applications

  • Me

    • Best web design company
    • Cal Evans Dot Com
    • Cheap Wine Diary
    • Cyrano’s Apprentice
    • Evans Internet Construction Company
    • My Life as a Child
    • PHP Podcasts
    • Sixty Second Tech

  • Tags

    adobe API article book Cal Evans codeworks community conference cw09 developers drupal elizabeth naramore Exim facebook flex freelance fun IBuildings Kathy Evans linkedin Management Marketing microsoft MySQL Nashville phar PHP phparchitect php developers podcast Programming Quickies respect Silly-Con Valley sixty second tech software development speaking startup twitter upgrade video web development wordpress zend zend framework

  • Categories

    • Apache
    • BlogBling
    • Blogging
    • codeworks
    • Entertainment
    • Entrepreneurship
    • Flex
    • Humor
    • JavaScript
    • Long Form
    • Management
    • Marketing
    • Me
    • PHP
    • podcasting
    • Programming
    • SQL
    • Technology
    • Web 2.0
    • wordpress
    • WordPress Plugins
    • writing
    • zend framework


Postcards From My Life is proudly powered by WordPress
Entries (RSS) and Comments (RSS).