Gracefully Drain Session from IIS Before Restarting/Stopping

综合技术 2015-01-08

I needed to do this recently when working with a team to automated releases of several websites.

The team have a fairly common setup. They’ve got more than one web server behind a load balancer, the load balancer calls a keep alive page to see if the servers are behaving and if they fail to respond stops sending them traffic until they’re healthy again.

What I wanted to do was rename the keep alive page, so the box stops getting new traffic, then wait for the existing sessions to complete and finally start updating it.

The second bit is key here, you don’t want customers using the site to get dropped mid-upload or form post.

I set about seeing what could be done with powershell and put together this little sample. It uses the IIS CmdLets to see how many sessions are still active and waits for them to complete before stopping IIS.

Thought it was a neat little sample worth sharing.

责编内容by:Grippers.co.uk (源链)。感谢您的支持!

您可能感兴趣的

Puppet Labs: Puppet IIS module: now Puppet Support... Puppet is excited to announce that thePuppet IIS module is now a Puppet Supp...
LinkPoint Payment Integration with IIS7 Hangs w3wp... My assemblies that wrap a third-party DLL work fine in my win...
部署eolinker开源版接口管理 下载到本地之后,使用最新的发布版本代码 我觉得官方提供的产品部署手册实在是太抽象了,可能是因为我不懂PHP吧,我是一个.net程序员。所以我把...
Clear duplicate fingerprint entries How do I clear APC cache entries? I need to clear all APC ...
Load DataCache from the entry point of the role to... I want to access my windows Azure Data Cache from my Role Entry StartUp routi...