Offline Files for Shared Configuration

  • Author: Walter Oliver
  • Published on December 02, 2007 by iisteam
  • Updated on July 29, 2009 by iisteam

Introduction 

Once you have enabled shared configuration, a common question is what happens when the network share that serves those files becomes unavailable. When the share goes down, the configuration system will detect a change notification (after the share times out) and WAS will try to reload the configuration resulting in failure. At this point, the web server will not be functional, the W3SVC service will be unable to access configuration. To ensure that the Web server can always access the configuration files, it is recommended that you use either Distributed File System (DFS) with replication or offline files.

Note: In Windows Server 2008 R2 (Windows 7), when the share goes down, the config system will send a special notification to WAS saying that there was an IO error when accessing the config file. At this time, WAS will continue using the cached copy of config that it currently has. Meanwhile, it will continue to poll the config system until the share comes back up (at which time, it will reload config). While WAS is running with cached config, if you stop WAS, or reboot the system, your webserver will stop working until the share comes back up.
.

The offline files feature, or client side caching, enables files stored on a network share to be accessed even when the network share is unavailable. It is a simple solution for ensuring the configuration files are always available and is recommended for the shared configuration files. However, offline files are not recommended for the Web site content, because this reduces throughput.

Problem summary: When IIS 7.0 server is configured to work in shared configuration mode then configuration files are stored on a file share. This configuration is recommended for setting up web farms. But in case file share goes offline, the whole set up fails and web servers stop responding. Moreover when the file share comes up again, IIS server is not able to detect it gives following error message:

HTTP Error 500.19 - internal server errorThe requested page cannot be accessed because the related configuration data for the page is invalid.

We have to do an IISreset to start the web servers again after this.

More Information

For Web site content, you may wish to consider using DFS for your file servers. For more information about DFS, go to the Distributed File System documentation at http://technet2.microsoft.com/windowsserver2008/en/library/1f0d326d-35af-4193-bda3-0d1688f90ea71033.mspx?mfr=true.

For more information about client side caching, go to  http://www.microsoft.com/.

Configuring Shared Configuration with Offline Files

Follow the below steps to set up shared configuration with offline files (client side caching) enabled.

Step 1: On the Web server, in Control Panel, open Offline Files.

Step 2: In the Offline Files dialog box, click Enable Offline Files. Do not reboot the machine yet.

Step 3: Ensure that the cache is set to read only by running the following command:

REG ADD "HKLM\System\CurrentControlSet\Services\CSC\Parameters" /v ReadOnlyCache /t REG_DWORD /d 1 /f

Step 4: Reboot the Web server.

Step 5: Browse to the file share folder from web server. Right click and select “Always Available Offline”.

Step 6: Go to control panel  -- > Offline Files. Select Schedule option.

Step 7: Schedule offline file sync after every 1 day or as per the requirement. This could be in minutes too. Even without setting up any scheduler, the moment I change anything in applicationhost.config file, it is reflected on the web server.

Now the web server works fine even if the file share is offline and there is no need of IISReset now.
Many thanks to Won Yoo and Amol Mehrotra for helping with the content.

 

Comments

I found you need the Desktop Experience installed for Offline Files to work:
http://msdn.microsoft.com/en-us/library/cc296092(VS.85).aspx

Feb 26 2009 by Bret Bentzinger

Hi All,

We have recently suffered an outage for all our sites and services as a result of patching. the pathcing was not at fault, the fact that the shared config server is a SPOF. Please all note, if you didnt already know this that if you reboot your shared config server all your sites will fail!

what is worse is that you need to reset IIS on all web servers once the share config server is back online afterwards....just a warning to shared config users out there.

you will read above that IIS will cache the info, it may cache the info but only for milli seconds! :(
There is my warning....

thanks
darian

Jul 28 2009 by darianva

Anyone know how to move the cache? I have a "data" drive Id like to move it to. Everything Ive seen is Vista specific. I have 2k8 server and am not really wanting to try vista instructions on a production server.
TIA

Jul 29 2009 by spankster

Hi All,
I have now enabled offline files for my shared config server.
However if I open the offline files on the web servers, I cannot see the applicationhost.config.
I can only see the administration.config.....Is that by design or is something not right?
thanks
Darian

Aug 25 2009 by darianva

Not sure why I saw the behaviour I did above...
I forced the offline dir to sync and that appears to have resolved the issue.
I am now able to view all offline files.
thanks
Darian

Aug 25 2009 by darianva

In our deployment, we had not found this info until we had already deployed our 57 server network of servers. We were using DFS on all servers for this and other settings as well, so we simply removed the UNC and referenced the local path that was part of a DFS-R replication group.

There multiple paths to success with this, but we too had a bumpy start...

CarlB

Oct 02 2009 by CarlB

Submit a Comment

You must Log In to comment.

Microsoft Communities