Solved

How to keep IIS from locking files?

Posted on 1998-05-04
2
229 Views
Last Modified: 2013-12-19
IIS (4.0) under Windows NT server 4.0 seems to lock html files after each read.  It seems to unlock them after some time.  Is there a way to prevent this locking to occur?

What I have found/read up to now:
If I stop and restart IIS, all files are now unlocked.

It doesn't seem to lock ASP files.  But it isn't a good solution to use ASP files instead of html because of speed (ASP files need to be parsed).  

The lock seem to be a read lock because some program are able to write over the file but some aren't.  (Maybe these programs look for a lock instead of a write lock).  

Someone tell to try changing this registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\GlobalExpire=??? to 0.  It said this worked for IIS 3.0 but this don't work for 4.0.

Programs that seem affected by this lock:
VisualSourceSafe (shadow folder)
TextPad (told by a friend)

Programs unaffected by this:
Notepad
VisualInterDev (told by a friend)
0
Comment
Question by:savardd
2 Comments
 
LVL 28

Accepted Solution

by:
sybe earned 100 total points
ID: 1560667
It's a bug in IIS4.
MS states the solution is to add DisableMemoryCache with value 1 to the registry.
(so not GlobalExpire)

In some cases that is still not enough. I "fixed" the problem then by forcing IIS to treat .htm and .html files as ASP. (ASP-files do not have the problem)

Since I don't have IIS4 at hand right now, I can't tell you exactly how to do that. But you can define which dll's IIS should use in handling files of a certain extension. There is a standard list, including a.o.
.asp handled by path\ASP.DLL
.asa handled by path\ASP.DLL
.stm handled by path\SSI.DLL
etc

I added ,htm and .html to this list and said it should be handled by asp.dll. It worked.

Of course it will have some impact on the performance of the server. Just as the DisableMemoryCache will have.



0
 

Author Comment

by:savardd
ID: 1560668
In the meantime, I found a way to resolve this problem.  There is
a registry entry:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\InetInfo\Parameters\ObjectCacheTTL  (Dword)

that keep the number of second to keep files open (locked).  By
setting it to 0, this disable this cache.


 ObjectCacheTTL       0x1E       0=IIS does not cache.
                                   30 seconds 0x1-0x7FFFFFFF
                         is the                                  
                                 maximum time an inactive
                                 object can remain in cache.
                                 0xFFFFFFFF=An object
                                 remains in cache until it is
                                 overwritten.


Thanks
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Join & Write a Comment

Enterprise networks where VoIP phones have been deployed frequently use port configurations that allow both a computer and an IP phone to be plugged into the same switch port but use different VLANs. On Cisco equipment I'm referring to the "native V…
The Need In an Active Directory enviroment, the PDC emulator provide time synchronization for the domain. This is important since Active Directory uses Kerberos for authentication.  By default, if the time difference between systems is off by more …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now