Postcards From My Life

Lint I find in my mind's belly-button.
  • EPK
  • Consulting
  • Resume
  • Nerd Herding
  • Talks
  • CWJ 09
« 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=

Related posts

  • MSWDS09 (4)
  • Microsoft and PHP (11)
  • XAMPP, PHP 5.3, PEAR, and PHAR (what a mess) (12)

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=

  • Team Based PHP Training

  • Sponsors and Ads

  • Conferences I’m Attending

  • About Me

    cal_evansThis is my blog. Sometimes it's my deep thoughts, sometimes it's a journal of things I've learned. Every now and then it's my box of shattered dreams. Most of the time though, it's just the place I like to write. Sit with me as I show you some postcards from my life. While you are here, do me a favor and leave a comment.

    If you are looking for my contact information, bio, picture, ASL, check out my EPK.

    My name is Cal Evans and this is my blog.



    Follow me on FriendFeed!

    View Cal Evans's profile on LinkedIn

  • My First Book

  • Support PHPWomen


    US Shop | European Shop

  • What I'm Doing...

    • @tswicegood good luck Hope you make it home. in reply to tswicegood 20 mins ago
    • @ramsey can't help it. She was a "large car" :) in reply to ramsey 1 hr ago
    • @brandonsavage @enygma @mtabini w00t y'all come on down! :) in reply to brandonsavage 2 hrs ago
    • More updates...

  • Tags

    API article Cal Evans codeworks conference contest cw09 developers devzone elizabeth naramore Exim flex fun IBuildings iPod jobs Kathy Evans linkedin Management Marketing microsoft MySQL Nashville phar photography PHP phparchitect php developers podcampnashville podcast podcasting poem Programming Quickies respect Silly-Con Valley sixty second tech software development terry chay twitter upgrade video wordpress zend zend framework

  • RSS PHP Podcasts

    • webcast: Introduction to Doctrine 2
    • 8 Reasons Every PHP Developer Should Love JavaScript
    • oddWeek Episode #4
    • Creating Custom Zend_Form Decorators
    • Habits of Highly Scalable Web Applications
    • PHPSPCast #6 – Ao vivo da Campus Party (Q&A)
    • php|architect Podcast: oddWeek #002
    • php|architect podcast: oddWeek #003
    • Podcast #2010-02: Stalker Edition
    • php|architect Podcast: oddWeek #001

  • XBox Gamer Card

  • Me

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

  • RSS My Blog at php|arch

    • An error has occurred; the feed is probably down. Try again later.

  • Flickr Recent Photos

    Blue Parabola Southern Office-Rear Annex is closed for snowSnow Heart@dzuelke getting ready to give his talk@fabpot talking about Dependancy Injection@derickr giving the opening keynotePeople meeting other peoplePHP Benelux Goody Bag ContentsCheck InDSCN2280The main room

  • 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

  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org


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