Solved

How to keep IIS from locking files?

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Many of us in IT utilize a combination of roaming profiles and folder redirection to ensure user information carries over from one workstation to another; in my environment, it was to enable virtualization without needing a separate desktop for each…
Resolve DNS query failed errors for Exchange
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

713 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