WinCache Archives - RuslanY Blog Azure App Service Features and Best Practices Fri, 31 May 2019 19:14:44 +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