Windows Azure Handbook (4) analyzes how Windows Azure handles session

Source: Internet
Author: User
Tags azure load balancer

Windows Azure Platform Family of articles Catalog

This article is a supplement to the author's previous article on how to handle the ASP. NET session under the instance scenario for multiple VMs in Windows Azure Cloud Service (13).

Here I will introduce both IaaS and PAAs platforms.

  

We know that in the Windows Azure platform, the session needs to be handled with care. For the IaaS platform and PAAs platform, we have the following methods for dealing with the session:

  

I. Create additional virtual machines, install Nginx or IIS arr reserved session

(1) Treatment method:

Create additional virtual machines, using Nginx or IIS arr to retain the session. Such as:

    

(2) Advantages:

    No need to modify any code

(3) Disadvantages

    Additional Azure Virtual machine needs to be created, adding additional costs .

(4) Related technical documents:

Slightly.

Two. Save the session to the database

(1) Treatment method:

By saving the session to the database, you can guarantee that the session will not be lost.

(2) Advantages:

   Also suitable for local hosting (On-premise) and cloud deployments (on cloud)

(3) Disadvantages:

Need to modify the code

(4) Related technical documents

Slightly

Three. PAAs platform, save session to In-role Cache

(1) Treatment method:

Save session to In-role cache to ensure session persistence

(2) Advantages:

You can use shared cache or dedicated cache

(3) Disadvantages:

   Suitable for PAAs platforms only

Need to modify the code

If you want to use dedicated Cache, you will add additional cost

(4) Related technical documents:

Windows Azure Cloud Service (42) uses Azure In-role cache caching (1) co-located Role

Windows Azure Cloud Service (43) uses Azure In-role cache caching (2) dedicated Role

 Four. Modify the azure load Balancer (load balancer) rule

(1) Treatment method:

The default Azure Load balancer rule is five features: source IP, source port, destination IP, destination port, protocol type.

We can change the rules to 2 features (source ip,destination IP) or 3 features (source IP, Destination IP, Protocol). This is the same client-initiated request that points to the same Azure destination server. In this way, you can keep the session. As shown in the following:

  

(2) Advantages:

No need to modify any code

(3) Disadvantages:

    If an azure customer is an enterprise-class customer, an enterprise-class customer accessing the Internet using a NAT device, because multiple clients use the same source IP address, can cause a single server to be under a lot of stress.

  (4) Related technical documents

    Azure PowerShell (8) Set up Azure load balancer rules with PowerShell

Five. Save session to Redis cache

This feature has been provided in the foreign azure, the domestic by the century connected operation of Azure has not provided the relevant functions, the author will be in the following blog post to do a detailed introduction.

Bo-Three Stone Blog (hereinafter referred to as Benbow), at the end of this blog article at the bottom of the right is not noted reproduced, source, provenance of the works (content) are the original, the site for the original content of the copyright reserved, do not arbitrarily reproduced, if the need for a friend can send mail contact me; reproduced original works (content ) must also follow the Creative Commons agreement "attribution-non-commercial use-consistent", be sure to indicate or retain the original source of the article and the information of the blogger (Lei Zhang) in the form of a text link, and be sure to keep in mind that the photograph works on this blog (www.cnblog.com/ Threestone) and other relevant watermark copyright information, otherwise deemed to infringe the original Copyright Act; Benbow declined commercial website reprint. All rights reserved, prohibit illegal and malicious plagiarism which violates the copyright protection Law of the People's Republic of China and related laws and Benbow (legal) statement.

Windows Azure Handbook (4) analyzes how Windows Azure handles session

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.