PHP 5.5, WinCache 1.3.5 available in Azure Web Sites

The recent upgrade of Windows Azure Web Sites includes several PHP related improvements:

First, the PHP 5.5 is now available. The PHP 5.4 becomes the default version used for newly created sites.

Note that there is no SQL Server Extension support for PHP 5.5.

Continue reading “PHP 5.5, WinCache 1.3.5 available in Azure Web Sites”

Azure Web Sites – WordPress plugin update bug fixed

Windows Azure Web Sites has recently been upgraded to a new version. Among all the improvements and bug fixes in the new version there is one change that fixes a known issue with update of WordPress plugins. There have been numerous questions about this problem at the Azure Web Sites forum.

Continue reading “Azure Web Sites – WordPress plugin update bug fixed”

RuslanY.net running on Windows Azure Web Sites

I have not been writing any blog posts for a while. That was because for the past two years I have been busy working in a team that develops the Windows Azure Web Sites – a scalable web hosting platform in Windows Azure.

Now that the Windows Azure Web Sites (WAWS) is publicly available I decided to try to move my site from private hosting  to Windows Azure. My site uses WordPress (with MySql database), PHP 5.3, WinCache object and user cache, URL rewriting and many WordPress plugins. With all these different technologies (many of which are not developed by Microsoft), I thought it would be a good test of how WAWS is capable of running web sites that use open source technologies. Plus I expect that my site will be more reliable and available, comparing to my previous private hosting.

I was pleasantly surprised that the migration from private hosting to WAWS hosting was relatively quick and simple. The site has been running successfully in a Shared compute mode for a while now and none of the site’s functionality has been lost or altered. In this post I’ll explain the steps I took to move my site to WAWS hosting. Hopefully it will be useful to those who are planning to migrate their WordPress based site to WAWS.

Continue reading “RuslanY.net running on Windows Azure Web Sites”

Slides and Questions from PHP on Windows Webcast

On April 9, Mark Brown and I did a PHP|Architect webcast “PHP Performance On Windows”. The slides from the presentation have been published at the following link:

PHP Performance on Windows – slides

There were a number of question at the end of the webcast that we did not get to answer due to lack of time. This blog post provides answers to those questions.

Continue reading “Slides and Questions from PHP on Windows Webcast”

Make WordPress faster on IIS with WinCache 1.1

This post used to contain PHP code for object-cache.php file. This code has been removed because it is out of date and has bugs. Instead, the latest version of WinCache Object Cache plugin from wordpress.org should be used.

This post explains how to improve performance of WordPress on Windows by using the WinCache Extension 1.1 – Beta for PHP. You probably already know that just by enabling the WinCache extension and without any code changes it is possible to get a significant increase in WordPress performance – this is described in details in PHP on Windows: The WinCache 1.0 Benchmark. But this can be taken even further by using the user cache API’s available in WinCache 1.1 release.

Continue reading “Make WordPress faster on IIS with WinCache 1.1”

More Performance Improvements in WinCache 1.1

Since the WinCache Extension for PHP has been released last year it has been widely deployed by customers who run PHP on Windows OS and it has proven to provide a substantial performance boost for PHP applications hosted on Windows-based web servers.

Today IIS team has published a beta of WinCache 1.1, which provides more options for improving performance of PHP applications on Windows. Specifically, the new version includes :

  • User Cache API’s, that 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. The addition of these API’s closes the remaining feature gap that WinCache had when compared with other similar caching solutions like APC and XCache.
  • WinCache Session Handler, that 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 beta builds of the extension can be downloaded and installed from the extension home page at: http://www.iis.net/expand/wincacheforphp (look for the “WinCache 1.1 – Beta” section there). The source code can be obtained from http://pecl.php.net/package/WinCache/1.1.0. The documentation for the extension can be found on PHP.NET WinCache documentation.

This is the beta release and the WinCache team is looking for your feedback on new features and functionality. Use the WinCache Community Forum to ask questions about the extension, report bugs and problems and to suggest features and improvements.

WinCache Extension 1.0.1 – Servicing Release

The new release of WinCache Extension for PHP – version 1.0.1 – is available for download. This is a servicing release that has fixes for bugs reported in v1.0. In particular the following fixes and changes have been made in this release:

  • Fixed require_once on PHP5.3. If the files were absolute and similar files were included in different case, require_once was including it twice.
  • Changed relative path cache to act as resolve path cache. Incremented refcounts under aplist lock. Did comparison using InterlockedCompareExchange.
  • Fixed crashes which were happening because aplist refcount and opcode cache refcount can get out of sync due to local cache.
  • Exposed is_local_cache property from ocache_fileinfo and fcache_fileinfo. Stats page will use this to indicate when local opcode data is shown.
  • Updated the wincache.php to pass chart data on query string to ensure that the charts show the same data that is displayed in tables
  • Updated the wincache.php to show whether information about a global or local cache instance is being displayed
  • Changed variable names and comments to indicate rplist is resolve path cache and not just relative path cache
  • Changed wincache.php to use resolve_path instead of relative_path

The new release is available for download from the extension’s home page at: http://www.iis.net/expand/wincacheforphp. The source code for the extension is available on PHP PECL page here: http://pecl.php.net/package/WinCache/1.0.1. The documenation for the extension can be found at http://www.php.net/manual/en/book.wincache.php.

WinCache Extension 1.0 for PHP – Release to Web

The Windows Cache Extension 1.0 for PHP – RTW is available for download. This is a final, production-ready release that is provided under an open source BSD license with the source code hosted and maintained on http://pecl.php.net/packages/wincache/.

Install the Windows Cache Extension 1.0 for PHP – RTW

To install the Windows Cache Extension 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 beta or RC release of the extension installed, then Web PI will upgrade it. If you install any PHP application by using Web PI then the Windows Cache Extension for PHP will be offered as an optional component.

Continue reading “WinCache Extension 1.0 for PHP – Release to Web”

Windows Cache Extension 1.0 for PHP – RC

The Windows Cache Extension 1.0 for PHP – Release Candidate is available for download. The release contains functionality and stability improvements and it is believed to have the quality level suitable for production deployments.

Install the Windows Cache Extension 1.0 for PHP – RC

To install the Windows Cache Extension for PHP 5.2 and PHP 5.3, use the download links at the extension’s home page at http://www.iis.net/extensions/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 beta release of the extension installed, then Web PI will upgrade it. If you install any PHP application by using Web PI then the Windows Cache Extension for PHP – RC will be offered as an optional component.

If you install the extension manually, then follow the instructions at “Using Windows Cache Extension for PHP“.

Continue reading “Windows Cache Extension 1.0 for PHP – RC”

Windows Cache Extension for PHP and CPU usage

The FastCGI module in IIS has a configuration setting maxInstances, which controls the number of concurrently running php-cgi.exe processes that IIS creates to process PHP requests. To achieve optimal performance, it is recommended to fine tune this setting for your specific environment starting with 8-10 instances per CPU core (e.g. maxInstances=32 for quad-core CPU).

The Windows Cache Extension for PHP can be used to improve performance of PHP applications running on Windows operating systems. The extension caches the compiled PHP opcode in the shared memory, which helps to avoid re-doing of such CPU intensive operations as parsing and compiling of the PHP source code. This means that when Windows Cache Extension for PHP is enabled, less CPU cycles are required for a web server to process PHP requests. Because of that, the previously configured value for the FastCGI maxInstances setting may not be adequate to load the server’s CPU completely and it may be necessary to increase the value further.

Continue reading “Windows Cache Extension for PHP and CPU usage”