PANVEGA’s Blog

DotNet Development, SharePoint Customizing, Silverlight, MS Infrastructure and other tips and tricks

Updating Files after IIS Application Pool Recycling

Posted by PANVEGA on October 21, 2008

Problematic

Sometimes you have to update some files in you SharePoint 12 Folder. However it is not always possible updating files while someone access the application file. You can only access via read permission.

I have a custom webpart that accesses some XML files. However the XMLs should be updated via Webservice once a day.

As a developer, quite often you may have to recycle the application pool. IISReset is an option, alternatively you can just recycle a particular application pool.

Solution

You can automatically develope a task, which updates the current file after your IIS recycling Application Pool worker process starts. After recycling all current process are disconnected. You find the recycling timer properties e.g. on your SharePoint 80 application pool.

Note:

When you recycle an application pool, HTTP.SYS holds onto the client connection in kernel mode while the user mode worker process recycles. After the process recycle, HTTP.SYS transparently routes the new requests to the new worker process.

Thus, the client never “loses all connectivity” to the server – the TCP connection is never lost – and never notices the process recycle. It is enabled by default because that does not involve connectivity nor state.

Information

Application pools are made up of a listening and routing structure in HTTP.sys and one or more ready-to-start worker processes that are waiting to process incoming requests. In worker process isolation mode, you can configure IIS to periodically restart worker processes under certain conditions. This automatic restarting of worker processes is called recycling.

Recycling an application pool causes the WWW service to shut down all running worker processes that are serving the application pool, and then start new worker processes.

Recycling helps ensure that problematic applications do not cause other applications to fail, and that system resources can be recovered from unhealthy applications.

Much faster than an iisreset. I use that snippet often in debug or deployment scripts for SharePoint.

“%windir%\system32\iisapp.vbs” /a “SharePoint – 80” /r

“SharePoint – 80” is the application to recycle.

More Information:

http://blog.thekid.me.uk/archive/2007/11/23/remote-sharepoint-code-release-and-app-pool-recycling.aspx

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: