Set up Redis cache service on Windows Azure

Source: Internet
Author: User
Keywords Azure azure redis

Microsoft http://www.aliyun.com/zixun/aggregation/13357.html ">azure's Web services allow PHP site developers to set up websites (reference classes) if you want to use Cache to improve system performance, you can consider the Redis cache service on Azure (currently in the preview phase).

Establish Redis Cache Service

To use Redis cache, you currently need to go to the new Azure management interface in the preview to operate and select Redis Cache in the new service options.

New Redis Cache Service

Then choose which subscription to use, what scenario (Basic or Standard), and which data center to use for the cache (it is recommended to place your service in the same data center to reduce network latency) to provide services.

Redis Cache Plans

After the establishment, Azure needs some time to set up the service, once it is completed, it can be used immediately, but it can also see some states in the management interface, can point to the keys or Properties to see its setting.

Cache Properties

Click on the Properties to see the online information, as well as the port number.

Cache Information

The keys shown in the keys can be used to use the Redis Cache service.

How to use the PHP site on Web services

If you use Azure's Web services to run your PHP site, it's easy to connect to the Redis Cache, as long as the following steps:

First here to download the compiled, to the Windows environment of the PHP Redis expansion kit, remember to be based on the PHP version of your site to download the corresponding version, and to download VC9 compiled, NTS (non-thread-safe) version. (Of course you can also choose the familiar PHP Redis suite, here is just an example)

Unzip the downloaded suite and place the Php_redis.dll in your PHP project directory, for example, under Bin/php_redis.dll.

Before uploading the deployment suite, go to the management interface of the Azure Web site service, add an Php_extensions constant to the app settings, and then point to the expansion suite location (e.g., Bin\php_redis.dll to use Windows directory notation), Like this (figure for the new management interface of the website settings, in the current management interface can be found in the Settings page check):

Setting Php_extensions constant

Upload the expansion kit file, restart the site is done.

The above PHP Redis Cache is using this kit, and it's connected in the same way as this:

<?php

$redis = new Redis ();

$redis->pconnect (' You redis Cache hostname ');

$redis->auth ("Find key in the Keys page");

#开始使用 $redis do the cache operation ...

You can query how it is used on the GitHub page of the project.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.