WinCache Archives - RuslanY Blog Azure App Service Features and Best Practices Fri, 31 May 2019 19:30:53 +0000 en-US hourly 1 https://wordpress.org/?v=6.2.16 https://ruslany.net/wp-content/uploads/2019/05/cropped-web-32x32.png WinCache Archives - RuslanY Blog 32 32 PHP 5.5, WinCache 1.3.5 available in Azure Web Sites https://ruslany.net/2013/12/php-5-5-wincache-1-3-5-available-in-azure-web-sites/ https://ruslany.net/2013/12/php-5-5-wincache-1-3-5-available-in-azure-web-sites/#comments Wed, 11 Dec 2013 23:11:16 +0000 http://ruslany.net/?p=6713 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. Second, the latest version (1.3.5) of WinCache Extension for PHP  is used … Continue reading "PHP 5.5, WinCache 1.3.5 available in Azure Web Sites"

The post PHP 5.5, WinCache 1.3.5 available in Azure Web Sites appeared first on RuslanY Blog.

]]>
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.

Second, the latest version (1.3.5) of WinCache Extension for PHP  is used with all PHP versions available in Azure Web Sites (5.3, 5.4, 5.5). Note that with PHP 5.5 the WinCache extension relies on the the Zend Opcode cache and hence it has its own opcode cache disabled. This can be seen in the phpinfo() output:

All other cache types in WinCache Extension are still enabled (file cache, session cache, user cache).

The post PHP 5.5, WinCache 1.3.5 available in Azure Web Sites appeared first on RuslanY Blog.

]]>
https://ruslany.net/2013/12/php-5-5-wincache-1-3-5-available-in-azure-web-sites/feed/ 2
Azure Web Sites – WordPress plugin update bug fixed https://ruslany.net/2013/03/azure-web-sites-wordpress-plugin-update-bug-fixed/ https://ruslany.net/2013/03/azure-web-sites-wordpress-plugin-update-bug-fixed/#comments Wed, 20 Mar 2013 18:02:06 +0000 http://ruslany.net/?p=3021 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. After the service upgrade the Windows … Continue reading "Azure Web Sites – WordPress plugin update bug fixed"

The post Azure Web Sites – WordPress plugin update bug fixed appeared first on RuslanY Blog.

]]>
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.

After the service upgrade the Windows Azure Web Sites now uses a newer version of WinCache – 1.3.4. This version has a fix for for the plugin update problem. I tried it and was able to update all of plugins on my site without a problem:

Plugin Upgrade Works

Other PHP related changes in this release of WAWS include newer PHP version (5.3.19) and support for UTF-8 encoding for server variables REQUEST_URI and PATH_INFO.

The post Azure Web Sites – WordPress plugin update bug fixed appeared first on RuslanY Blog.

]]>
https://ruslany.net/2013/03/azure-web-sites-wordpress-plugin-update-bug-fixed/feed/ 5
RuslanY.net running on Windows Azure Web Sites https://ruslany.net/2012/10/ruslany-net-running-on-windows-azure-web-sites/ https://ruslany.net/2012/10/ruslany-net-running-on-windows-azure-web-sites/#comments Mon, 22 Oct 2012 15:30:36 +0000 http://ruslany.net/?p=1401 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 … Continue reading "RuslanY.net running on Windows Azure Web Sites"

The post RuslanY.net running on Windows Azure Web Sites appeared first on RuslanY Blog.

]]>
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.

1. Signing up and creating an empty site

The sign up process is straightforward and quick. If you have not signed up before then you can get a 90-days free trial, where you can try all the WAWS hosting options for free. Once you complete the sign up process you will end up at the Windows Azure Management Portal and start creating sites. In my case I started by creating an empty free web site http://ruslany.azurewebsites.net. It takes only a few seconds to create a new site.

2. Creating a MySql database

WAWS works in partnership with ClearDb to provide MySql databases. If you have a relatively small web application with light traffic then the free MySql database provided in Windows Azure should be enough for you. You can create the database by going to the Linked Resources page  and adding a new Linked Resource:

Create MySql DB

My site’s database was bigger than 20 Mb in size, so I had to purchase the Venus Service Plan on the ClearDB site.

3. Importing data to a MySql database

WAWS provides a web management interface for SQL Azure databases. But not for MySql databases. That was not a problem however, because there is a well known web application for administering MySql – phpMyAdmin. To import the content of my blog I created a new site under my subscription (10 free sites are allowed per subscription) and installed phpMyAdmin there. phpMyAdmin provides a simple way of importing MySql content into a database:

Import Db Data

Unfortunately, phpMyAdmin is not yet available in the Windows Azure Web Application Gallery, so I had to install it manually by following the quick install guide.

Important thing to note about importing data using phpMyAdmin. Import requires uploading a sql file to the server. If the sql file is big, you may run into the PHP limit for maximum allowed size of uploaded file. It is possible to increase the limit by following instructions at Configuring PHP in Windows Azure Websites with .user.ini Files.

4. Point WordPress to new database

Once database import is complete, it is necessary to reconfigure WordPress to use new database. The configuration is stored in wp-config.php file. Change the DB_NAME, DB_USER, DB_PASSWORD, DB_HOST variables to the values provided by ClearDB.

5. Uploading the site content

There are several ways to publish content in WAWS:

  1. FTP
  2. WebDeploy
  3. Git
  4. TFS

In order to simplify publishing, I recommend to set the publishing password to something you can remember. Otherwise you’ll have to use the randomly generated password that WAWS provided for your site.

Reset Publishing Password

FTP was good enough for my needs. The FTP host name and user name are available in the site dashboard page. You can use any FTP client. Filezilla works pretty well for uploading large content.

5. Configuring custom domains

After I uploaded content I just browsed to http://ruslany.azurewebsites.com/ and the site was up and running. Obviously I did not want to use this domain for my site, so the next step was to associate http://ruslany.net/ with this site.

Free sites in WAWS are not allowed to have custom domains, so I had to upgrade my site to “Shared” compute mode.  Apart from custom domains support, there are other benefits of this mode: less restrictive usage quotas and no outgoing bandwidth limit.

Configuring custom domain is a straightforward process described in Windows Azure documentation. It is a good idea to associate both A record and the WWW CName with a site. In my case for example both http://ruslany.net and http://www.ruslany.net/ are associated with the site:

Custom Domains

Conclusion

There are a couple of minor limitations that still need to be fixed in WAWS:

  • An old version of Wincache extension is used which causes failures when upgrading plugins.
  • It would be nice to have phpMyAdmin available in the Web Application Gallery.

Other than that I am pretty happy with how my site is running in Windows Azure Web Sites so far. WAWS is capable and flexible enough to support all the custom configuration settings that my site uses.

  • Wincache object and user caches work well. They reduce load on the MySql database and make the response time faster.
  • URL rewriting is fully supported, so my site is still optimized for search engines and has pretty permalinks.
  • All the plugins work without problems.

As I find out more tips and tricks about hosting web sites in Windows Azure Web Sites I will write about them in this blog.

The post RuslanY.net running on Windows Azure Web Sites appeared first on RuslanY Blog.

]]>
https://ruslany.net/2012/10/ruslany-net-running-on-windows-azure-web-sites/feed/ 6
Slides and Questions from PHP on Windows Webcast https://ruslany.net/2010/04/slides-and-questions-from-php-on-windows-webcast/ https://ruslany.net/2010/04/slides-and-questions-from-php-on-windows-webcast/#comments Tue, 13 Apr 2010 19:11:56 +0000 http://ruslany.net/?p=737 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 … Continue reading "Slides and Questions from PHP on Windows Webcast"

The post Slides and Questions from PHP on Windows Webcast appeared first on RuslanY Blog.

]]>
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.

Q: Why is php_mssql.dll removed from php 5.3.2?
A: The reason why it was removed was because of an incompatible driver. The last SDK supported by Microsoft was not compatible anymore with VC6. Anyway, php_mssql.dll is not recommended to be used with SQL Server because there is a SQL Driver for PHP that is officially supported by Microsoft. You can get more information about the driver at Working with Microsoft SQL Server driver (php_sqlsrv.dll) for PHP on Windows.

Q: How can we have .htaccess file features work on IIS? Is there an alternative?
A: There are several options. If you just want Apache mod_rewrite rules to work on IIS, then you can import them from a .htaccess file. If you want complete support for all .htaccess features then you can try Helicon Ape from HeliconTech. Regarding PHP specific features in .htaccess file – for PHP 5.2 you could use htscanner PECL extension. In PHP 5.3 there is a new feature for per directory PHP configuration and .user.ini files.

Q: Do you have any numbers to compare iis performance with other web servers(apache, nginx, lighttpd)?
A: No, we do not have any numbers that can be shared. It’s difficult to come up with an objective test that compares web server technologies – there are too many variables and interpretations of the results and even if Microsoft ever produced such numbers they would probably cause a lot of controversy over the objectivity of those tests.

Q: Do you plan to implement wincache library for Zend Framework(Zend_Cache)?
A: WinCache team does not have plans for that, but there is already a PHP developer who is working on implementing this: http://github.com/juokaz/wincache.

Q: We have discussed here sugar CRM. Is Microsoft planning to do enhancement in sugar CRM functionality?
A: Microsoft works well with Sugar CRM development team and Sugar CRM add enhancements to their future versions to support new features from Microsoft, such as WinCache user and session cache for example. Microsoft, however does not contribute any code and does not work directly on any enhancements to Sugar CRM.

Q: Is Microsoft planning to develop any dll which can make PHP code to Intermediate language?
A: Assuming that the question is about .NET intermediate language – no, there are no plans for this.

Q: Would there be any tool in Microsoft development tool kit for PHP?
A: There are several projects in Microsoft that provide development tools and instructions for enabling interoperability between PHP and other Microsoft technologies. You can find more details about those projects here: http://www.interoperabilitybridges.com/.

Q: Is WinCache shared data accessible for CLI? Script A launches Script B, C and D … ?
A: Yes, you can access the shared data from CLI as long as you set wincache.enablecli = 1 in php.ini and all the CLI processes have the same parent process.

Q: Are the statistics results of WinCache the same in 5.2.13 as in 5.3?
A: If the question is about wincache.php statistics script then yes – the data presented by that script is the same regardless of the PHP version.

Q: Are there any security concerns with having wincache store session data in shared memory?
A: If you use different IIS application pools for different web sites (which is the recommended configuration), then WinCache ensures that those web sites can not access each other’s cache data. All caches, not just the session cache are not shared across IIS application pools.

Q: Is it safe to write to the user cache assuming data disappears from the system after the cache times out? Is the content of the user cache in wincache 1.1 written to disk at all?
A: Normally the data in the user cache is deleted from the cache after the time to live interval, but the deletion happens on the main request processing thread. This means that if there are no requests to process, the entries in the cache may stay longer than the TTL. WinCache does not write user cache content to disk, but if memory pagefile is enabled on the server, then it may happen that the memory content will be stored by OS in a pagefile. If a maching (not just a process) crashes when user cache content is in the pagefile, then the content may be present on disk.

Q: Is the sqlsrv driver going to be compatible with PDO?
A: SQL Driver for PHP 2.0 will include PDO support.

Q: Is there any documentation on securely configuring php/FastCGI in a shared application pool environment on IIS6 so that websites?
A: Check the article about setting up PHP on IIS6 and look for the section called “Impersonation and file system access”. If this is not what you are looking for – let me know.

Q: When are we going to see PHP 5.3 in the WPI?
A: Web PI team is planning to add support for PHP 5.3 in near future. Most probably it will be possible to select which version of PHP to install from Web PI. This is because there are some PHP applications in Web PI that will never support PHP 5.3.

Thanks to all who has attended the webcast and asked interesting questions!

The post Slides and Questions from PHP on Windows Webcast appeared first on RuslanY Blog.

]]>
https://ruslany.net/2010/04/slides-and-questions-from-php-on-windows-webcast/feed/ 2
Make WordPress faster on IIS with WinCache 1.1 https://ruslany.net/2010/03/make-wordpress-faster-on-iis-with-wincache-1-1/ https://ruslany.net/2010/03/make-wordpress-faster-on-iis-with-wincache-1-1/#comments Sat, 06 Mar 2010 00:12:42 +0000 http://ruslany.net/?p=673 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 … Continue reading "Make WordPress faster on IIS with WinCache 1.1"

The post Make WordPress faster on IIS with WinCache 1.1 appeared first on RuslanY Blog.

]]>

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.

To configure WordPress to use WinCache user cache API’s download the WinCache Object Cache Backend plugin, extract the object-cache.php file from it and put it in the /wp-content/ directory of your WordPress site.

That should be all you need to do. To verify that the WordPress is actually using the object cache use the WinCache Statistics Script and check the “User and Session Cache” page:

The post Make WordPress faster on IIS with WinCache 1.1 appeared first on RuslanY Blog.

]]>
https://ruslany.net/2010/03/make-wordpress-faster-on-iis-with-wincache-1-1/feed/ 31
More Performance Improvements in WinCache 1.1 https://ruslany.net/2010/03/more-performance-improvements-in-wincache-1-1-beta/ https://ruslany.net/2010/03/more-performance-improvements-in-wincache-1-1-beta/#comments Thu, 04 Mar 2010 09:10:19 +0000 http://ruslany.net/?p=660 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 … Continue reading "More Performance Improvements in WinCache 1.1"

The post More Performance Improvements in WinCache 1.1 appeared first on RuslanY Blog.

]]>
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.

The post More Performance Improvements in WinCache 1.1 appeared first on RuslanY Blog.

]]>
https://ruslany.net/2010/03/more-performance-improvements-in-wincache-1-1-beta/feed/ 2
WinCache Extension 1.0.1 – Servicing Release https://ruslany.net/2010/01/wincache-extension-1-0-1-servicing-release/ https://ruslany.net/2010/01/wincache-extension-1-0-1-servicing-release/#respond Tue, 26 Jan 2010 22:39:41 +0000 http://ruslany.net/?p=643 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 … Continue reading "WinCache Extension 1.0.1 – Servicing Release"

The post WinCache Extension 1.0.1 – Servicing Release appeared first on RuslanY Blog.

]]>
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.

The post WinCache Extension 1.0.1 – Servicing Release appeared first on RuslanY Blog.

]]>
https://ruslany.net/2010/01/wincache-extension-1-0-1-servicing-release/feed/ 0
WinCache Extension 1.0 for PHP – Release to Web https://ruslany.net/2009/11/wincache-extension-1-0-for-php-release-to-web/ https://ruslany.net/2009/11/wincache-extension-1-0-for-php-release-to-web/#comments Thu, 19 Nov 2009 19:01:05 +0000 http://ruslany.net/?p=605 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 … Continue reading "WinCache Extension 1.0 for PHP – Release to Web"

The post WinCache Extension 1.0 for PHP – Release to Web appeared first on RuslanY Blog.

]]>
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.

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

Note:

  • The extension can only be used with non-thread-safe builds of PHP
  • The extension can only be used when IIS is configured to run PHP via FastCGI
  • The Windows Cache Extension 1.0 for PHP 5.3 can only be used with the x86 VC9 build of PHP 5.3.

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:

Getting the extension source code

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

Bug fixes and changes since the RC release:

Here is the list of changes and bug fixes that have been made since the RC release of WinCache. For the complete list of WinCache features and configuration options refer to the WinCache documentation:

  • Added new INI directive wincache.fcenabledfilter that can be used to turn on/off file cache for individual IIS sites.
  • Fixed a bug that caused include_once() function to load file twice because relative file path was case insensitive.
  • Changed cache size default values. Default size of file cache is 32 MB and opcode cache is 96 MB.
  • Changed minimum and maximum values of file cache size and opcode cache size.
  • Added an auto adjustment of the opcode cache size to ensure it is at least 3 times bigger than file cache size.
  • Fixed several bugs in cache scavenger logic that caused access violations and crashes in php-cgi.exe processes.
  • Fixed a bug in exception handling that caused php-cgi.exe process to crash.
  • Modified the charts in wincache.php to display the numbers rounded to 2 digits after decimal point.
  • Fixed the wincache.php authenticaiton logic to not conflict with IIS built-in authentication.
  • Added memory usage pie charts to wincache.php file.
  • Updated the wincache.php to show a warning if opcode cache size is too small and it has been automatically increased.
  • wincache.php will now display entries in opcode cache, file cache and relative path cache in lexicographical sorted way.

Thanks!

WinCache Team thanks all of you who have installed and tried early releases of WinCache extension and provided us with feedback, bug reports and feature suggestions through the Windows Cache Extension for PHP Forum. Your involvement throughout the release process has been very valuable to us and really helped us make this a great release!

The post WinCache Extension 1.0 for PHP – Release to Web appeared first on RuslanY Blog.

]]>
https://ruslany.net/2009/11/wincache-extension-1-0-for-php-release-to-web/feed/ 6
Windows Cache Extension 1.0 for PHP – RC https://ruslany.net/2009/10/windows-cache-extension-1-0-for-php-rc/ https://ruslany.net/2009/10/windows-cache-extension-1-0-for-php-rc/#comments Tue, 20 Oct 2009 05:45:47 +0000 http://ruslany.net/?p=576 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 … Continue reading "Windows Cache Extension 1.0 for PHP – RC"

The post Windows Cache Extension 1.0 for PHP – RC appeared first on RuslanY Blog.

]]>
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“.

Note:

  • The extension can only be used with non-thread-safe builds of PHP
  • The extension can only be used when IIS is configured to run PHP via FastCGI
  • The Windows Cache Extension 1.0 for PHP 5.3 can only be used with the x86 VC9 build of PHP 5.3.

Changes since the beta release

Here are the features that are new since the beta release (for complete list of bug fixes and features since the beta release refer to the blog post by the WinCache developer Kanwaljeet Singla):

  • New API to refresh the cached files. If your PHP application updates some PHP files (for example files with configuration settings or template files) and then needs to load those files on a next request then this API can be used to refresh the cache for those files.
  • Disabling the file change checking. The Windows Cache Extension periodically checks if the cached files have been changed on a file system. By default the check happens every 30 seconds. If you do not expect the PHP files for your application to ever change then you can disable this check.
  • Enabling or disabling the opcode cache on a per-site basis. The new configuration setting wincache.ocenabledfilter can be used in conjunction with wincache.ocenabled to specify a comma-separated list of IIS web site identifiers that should have the opcode caching enabled or disabled.
  • Disabling the cache when PHP is run in command line mode. By default the cache will be disabled when PHP scripts are executed in a command line mode (CLI). If necessary the cache can be turned on by using the configuration setting wincache.enablecli.
  • Total cache uptime information. The API’s wincache_fcache_fileinfo() and wincache_ocache_fileinfo() now also report the total cache uptime.
  • Cache statistics web page. The RC installation package includes a PHP script that can be used to get the cache statistics.
    WinCache Statistics Script

More information

Use the Windows Cache Extension for PHP Forum to ask questions, report bugs and provide feature suggestions.

The post Windows Cache Extension 1.0 for PHP – RC appeared first on RuslanY Blog.

]]>
https://ruslany.net/2009/10/windows-cache-extension-1-0-for-php-rc/feed/ 1
Windows Cache Extension for PHP and CPU usage https://ruslany.net/2009/09/windows-cache-extension-for-php-and-cpu-usage/ https://ruslany.net/2009/09/windows-cache-extension-for-php-and-cpu-usage/#comments Thu, 03 Sep 2009 00:17:49 +0000 http://ruslany.net/?p=538 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 … Continue reading "Windows Cache Extension for PHP and CPU usage"

The post Windows Cache Extension for PHP and CPU usage appeared first on RuslanY Blog.

]]>
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.

To increase the maxInstances value on IIS 7 run this command from an elevated command line prompt:

appcmd.exe set config  -section:system.webServer/fastCgi /[fullPath='C:\PHP\php-cgi.exe',arguments=''].maxInstances:"32"  /commit:apphost

Note: replace the fullPath with the path to php-cgi.exe on your server.

Alternatively you can just edit the <fastCGI> section the applicationHost.config file located at C:\Windows\System32\inetsrv\config\ folder:

<fastCgi>
  <application fullPath="C:\PHP\php-cgi.exe" maxInstances="32">
  <!-- Some other settings may go here-->
  </application>
</fastCgi>

To increate the maxInstances value on IIS 5.1 and IIS 6.0 run this command:

>cscript C:\windows\system32\inetsrv\fcgiconfig.js -set -section:"PHP" –MaxInstances:32

Note: replace the section name if necessary.

Alternatively you can edit the fcgiext.ini file located at C:\Windows\System32\inetsrv\ folder:

[PHP]
ExePath=C:\PHP\php-cgi.exe
;some other settings may go here
MaxInstances=32

When you measure the performance of the Windows Cache Extension for PHP, make sure to monitor the CPU usage. If you see that CPU is not fully utilized try increasing the FastCGI maxInstances setting and you may be able to get better performance results.

The post Windows Cache Extension for PHP and CPU usage appeared first on RuslanY Blog.

]]>
https://ruslany.net/2009/09/windows-cache-extension-for-php-and-cpu-usage/feed/ 11