WinCache Extension 1.1 for PHP – Release to Web

Today IIS team has published the final release of WinCache Extension 1.1 for PHP. This is the latest stable and production ready version of the extension. The v1.1 has all the features available in version 1.0 plus the following features.

  • User Cache API’s can be used by PHP scripts to store PHP objects and variables in shared memory. This way PHP scripts may improve the execution speed by storing processed data in the cache and then using it in subsequent requests instead of re-creating the data on every request.
  • WinCache Session Handler can be used to configure PHP to store the session data in shared memory cache. Using shared memory instead of the default file session storage helps improve performance of PHP applications that store large amount of data in session objects. The content of the WinCache session cache is persisted on disk so that it is not lost during IIS worker process recycling.
  • File Change Notifications – the entries in the opcode and file caches are now updated as soon as the corresponding PHP files are modified on a file system. This is very useful for PHP applications that store its configuration in PHP files – for example Joomla!. Now the configuration changes for those applications take effect right away instead of a 30 seconds delay (default cache refresh interval).
  • Lock/Unlock API’s – these API’s can be used to obtain/release an exclusive lock on a key in the cache.

Install the Windows Cache Extension 1.1 for PHP – RTW

To install the WinCache Extension 1.1 for PHP 5.2 and PHP 5.3, use the download links at the extension’s home page at http://www.iis.net/expand/WinCacheForPhp.

The installation with Web Platform Installer is the easiest as it will automatically place the extension binary into proper location and will update the PHP configuration to enable the extension. Also, if you have the previous version of the extension installed, then Web PI will upgrade it. If you install any PHP application by using Web PI then the WinCache Extension 1.1 for PHP will be offered as an optional component.

If you install the extension manually, then follow the instructions at Installing/Configuring WinCache for PHP.

Getting the extension source code

The source code for the extension is available at http://pecl.php.net/package/WinCache/1.1.0stable. For the instructions on how to build the extension yourself refer to Building WinCache Extension.

Getting support

The WinCache extension is not supported by Microsoft Product Support Services. Instead it is supported as any other community PHP extension via the forums, mailing lists and the PECL bugs database. Use the following resources:

93,366 views

ruslany on June 30th 2010 in PHP, WinCache

PoorFairAverageGoodExcellent (7 votes, average: 3.14 out of 5)

7 Responses to “WinCache Extension 1.1 for PHP – Release to Web”

  1. Gravatar ImageSirius Lee responded on 01 Sep 2010 at 10:53 am #

    I have the version of WinCache (from the Microsoft WebInstaller) installed on an IIS7 server. The PHPInfo() shows the extension is enabled but the wincache.php page shows no activity. The PHP handler uses FastCGI.

    Is there something else I should be doing to have the extension do its thing?

    Thanks in advance.

  2. Gravatar Imageruslany responded on 01 Sep 2010 at 4:46 pm #

    Hi Sirius Lee,

    What does phpinfo show for wincache.ocenabled and wincache.fcenabled settings? They should be both set to 1.

  3. Gravatar ImageSirius Lee responded on 04 Sep 2010 at 9:13 am #

    Thanks. Running the WinCache script work when called directly. I’ve been trying to get the cache script presented as a Joomla backend component. The component is easy enough but when run this way the script report(s) are shown but they don’t pick up any of the WinCache stats. I’m looking at other examples like WordPress and Drupal to see how it’s been done.

  4. Gravatar ImageSirius Lee responded on 04 Sep 2010 at 3:17 pm #

    My mistake. The globals needed to be different in Joomla. Great that you provided the php script.

  5. Gravatar ImageDareDemo responded on 18 Sep 2010 at 11:34 pm #

    Thanks for the details on this!

    I’d looked into a way around that perplexing 30 second delay back in April/May but didn’t run across what was actually causing it. Have been gritting my teeth about it when debugging on the dev platform ever since.

    Searched again and there was the information you’d posted, front and center.

    1.1 works like a charm. Sweet.

    Thanks again — future work on this platform is looking far more efficient from here on out.

  6. Gravatar ImageRafael responded on 27 Jan 2011 at 10:10 pm #

    Hi Ruslan,

    I’ve been reading your work on PHP and IIS for a long time and you helped me out with some wordpress stuff before. I have an issue where one of my clients is running Dolphin 7.0.4 with Ray Media server on my Windows 2008 R2 machine and it is a real mess.

    If you haven’t worked with or heard of Dolphin it’s a bloated CMS with lots of Social Plugins, Chat, and Video uploads built in PHP it’s very Linux and Apache focused so the forums aren’t all that great for developing on Windows. The problem is that the php-cgi.exe processes keep spawning out of control, at some times during busy traffic I get 60 processes going at once. So my server was constantly at 100% CPU usage.

    I have PHP 5.3 and WinCache 1.1 working on the my server and I adjusted my FastCGI settings to allow more exeuction time. That helped but it’s still really high usage. I have log files for the last few weeks and each day’s log file is over 1.5 GB. It’s nutty, the site shows 30 to 50 unique visitors per hour and it has over 1200 members now in it’s third week. But it’s reall resource intesive and I can’t run my other sites that are on that server.

    I have the logs, screen shots of my FastCGI settings, and the screen shots of my WinCache output file. One thing that is not operating for Wincahce is the UserCache because I don’t know how to set it up for this CMS. Also on the Dolphin forums has the mindset of code that is very much spageghti code and letting unknowledgeable non-IT people run a mock with it. Whenever you get to knowledgeable people, they almost always have a Linux Apache expertise and I don’t know about Windows mindset. So it’s very frustrating.

    So I figured you’d be a good person to ask for help, I’m willing to follow up on any instructions you give me I ahve a good deal of data about the site, logs, and specs, also Google Analytics on the traffic – I’m just lost as to where to begin on this or how to go about finding out where to look for answers as to where the problem is with such high CPU usage and multiple php-cgi.exe processes. I also set the Max instances to 0 in the FastCGI settings I had it at 4 before, my CPU is a Xeon Quad core so it has 4 cores. I also figure this would a be a good project for you to gain insight to which I can help you with and you can post about it in regard to PHP and Windows because Dolphin has a strong following in LAMP circles, ones that like bloat CMS with Video and all that at least. If we can figure out a way to get this to scale and perform well on Windows with the Ray Media server, that would be a major achievement as far as being able to provide documentation about that, because I’ve looked all over and can’t find any such documentation.

    Anyway, let me know if you want to help me and I’ll send you a Contact message to see if we can follow up with an email.

    Thanks,

    Rafael

  7. Gravatar Imageruslany responded on 01 Feb 2011 at 11:03 pm #

    Hi Rafael,

    I have not heard of Dolphin CMS, but based on your explaination I would not be surprised that it loads the CPU up to 100% on your server.

    The first thing I would try is to set the FastCGI MaxInstances setting to some constant value other than 0. That way you will have one less variable to worry about when you analyze the load on the server. You said you had it set to 4 before. What was the CPU load then?

    What is the behavior you are getting on your site right now when it is under load? Do you see requests dropped? Or is it just slow?

    When you check the wincache.php stats, how many files do you see cached by WinCache?

Trackback URI | Comments RSS

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

XML Markup: If You want to add XML code to the comment please XML encode it first, otherwise the code will not show up.

Recently Published Articles