Solved

How to keep IIS from locking files?

Posted on 1998-05-04
2
266 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

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A brief overview to explain gateways, default gateways and static routes OR NO - you CANNOT have two default gateways on the same server, PC or other Windows-based network device. In simple terms a gateway is formed when a computer such as a serv…
Have you ever set up your wireless router at home or in the office to find that you little pop-up bubble in the bottom right-hand corner of Windows read "IP Conflict - One of more computers on the network have been assigned the following IP address"…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

792 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