GoodSpeed
GoodSpeed

Reputation: 323

Sliding Expiration in Windows Azure

i deployed a webrole in Widnows Azure. in the webconfig i specified the session state mode which is InProc mode, the timeout is 120 minutes.

the session expires after 20 minutes and there is no sliding expiration.

anyone has an explanation for this ? i know that the default value for the timeout in windows azure is 20 minutes. but is there a sliding expliration in windows Azure or he just ends the session after 20 minutes ?

I dont want to use a different mode for the session state.

Upvotes: 1

Views: 620

Answers (2)

Rui
Rui

Reputation: 175

In the new caching options for Windows Azure launched in the 1.7 release, it's possible to choose one of three different types of expiration: None, Absolute and Sliding Window, and on these last two you can define a time-to-live.

And as you said that you wanted to use the InProc session, you can use now the Co-located Role caching mechanism which as the best of both worlds: it's memory based and scalable, and no additional costs since it uses a defined percentage of the instances memory.

Upvotes: 1

David Makogon
David Makogon

Reputation: 71091

There's an AppPool timeout of 20 minutes (discussed in other answers such as this one). In general, session state management should work the same as an on-premises app, since the VMs are Windows 2008 Server R2 / SP2.

I do question your use of in-proc session state handling though: once you go to multiple instances, you'll no longer have session state consistency. The load balancer does not provide stickiness: clients will be load-balanced across all your instances, with no way to force traffic to a specific instance (unless you enable ARR and set up your own load balancing).

With the Spring 2012 Windows Azure update, there's now both a dedicated Cache Role and the ability to run a cache within an existing role (such as a web role). If you enabled this, you'd get very fast in-memory caching which could serve as your session state backing store.

Upvotes: 1

Related Questions