locked
IIS 7.0 Killing my CIFS Storage looking for web.config files everywhere RRS feed

  • Question

  • User-435319616 posted

    Hi,

    we have recently migrated a large web site from IIS 6.0 to IIS 7.0 and we are encountering a serious issue.

    I know that IIS 7.0 can locate a web.config file on each and every web site folder to store local configuration but I'm looking for a way to prevent IIS from looking for it.

    We have a large web farm (35 web servers) built to sustain a very high traffic expected to reach our site in two months but in this moment I had to stop all but 9 servers to avoid unavailability of the site due to overload on the central storage.

    The Web site content is distributed over 4 different NetApp storage system accesses as CIFS shares. The web site is composed by a large number of folders and subfolder to store all the content.

    Everytime a request reach a web server this execute a series of 'create file' operation on the storage, one for each subfolder plus one for the file itself (example: a request made for '/images/ml/flags/ita.gif' generates a 'create file' operation for /images/web.config, /images/ml/web.config, /images/ml/flags/web.config, /images/ml/flags/ita.gif/web.config). To give you the magnitude of this problem we had 80.000 CIFS Operations per second just looking into one of the 4 NetApp storage during a very standard traffic day.

    For each request a series of 'create file' operation on the web.config (in the various locations) is done, the same is done for the second request for the same file. At that point other requests do not generate new 'create file' operations but only for 3 minutes, after 3 minutes it starts again for 2 requests and so on. This for each single file or folder requested.

    Because of the way we do manage the application I can be sure that I'll never put any web.config file out of the root folder of the web site, so I would really need a mechanism to disable this activity, forcing IIS 7.0 and Asp.Net 2.0 to look for web.config file only and exclusively on the root folder of the web site. 

    I've tried to get this result using the "allowdefinition" attribute on the section of the config files (I inserted it for each and every section restricting it to webroot only) but this had no result. I've tried with both 'classic' and 'integrated' pipelines with no changes.

    Anyone has any idea?

    Thanks

    Rauno

    Friday, March 19, 2010 2:17 PM

Answers

  • User-267369003 posted

    You can tell IIS to only look for web.config files at the root of virtual directories (no sub dirs) by setting allowSubdirConfig=false the vdir in question, or globally for all vdirs.  This command will set it globally:

    c:\windows\system32\inetsrv\appcmd.exe set config -section:system.applicationHost/sites /virtualDirectoryDefaults.allowSubDirConfig:false /commit:apphost

    You might have to re-start W3SVC to make it work. 

    Hope that helps things.  It doesn't eliminate the web.config accesses but should decrease them significantly.

     

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Friday, March 19, 2010 4:41 PM

All replies

  • User-267369003 posted

    You can tell IIS to only look for web.config files at the root of virtual directories (no sub dirs) by setting allowSubdirConfig=false the vdir in question, or globally for all vdirs.  This command will set it globally:

    c:\windows\system32\inetsrv\appcmd.exe set config -section:system.applicationHost/sites /virtualDirectoryDefaults.allowSubDirConfig:false /commit:apphost

    You might have to re-start W3SVC to make it work. 

    Hope that helps things.  It doesn't eliminate the web.config accesses but should decrease them significantly.

     

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Friday, March 19, 2010 4:41 PM
  • User-435319616 posted

     Hi,

     thanks, this is really helping keeping access under control.

    I've just tested it, it does not require IISRESET.


    Thanks


    Rauno

    Sunday, March 21, 2010 7:10 PM
  • User-852409647 posted
    Rauno (or anyone), I was curious what tool you had used to diagnosis that the create file operations were happening for all the web.config folders?  I'd like to be sure I'm not running into this issue.  Thanks!
    Wednesday, May 2, 2012 3:48 PM
  • User1073881637 posted

    Take a look at the threads in this tag

    http://www.iislogs.com/tags/unc

    Wednesday, May 2, 2012 7:38 PM
  • User-852409647 posted
    I have in the past and I've looked again and none of those gave and indications on how to do tracing/monitoring on the netapp side for CreateFile requests, FileChangeNotifications, etc.
    Friday, May 4, 2012 7:15 AM