Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am running an Apache 2.2.4 on Windows 64bit using the local NTFS file system. I enabled the Mmap option and noticed that Apache seems to acquire a write lock and hold onto it for a long period. In my example it is serving a 2MB XML file.

Unfortunately I need another process to be able to update this XML file periodically but the lock will make it impossible. As soon as I disable MMap the writing to the XML file works well.

Can you point me in the right direction to learn more about MMap and why it acquires the lock and how to enable it to allow the file to be updated by a second process?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

MMap maps the file into memory. On Windows, you cannot modify a file that is mapped into memory. If you need to modify the file, and can't restart the server to do so, you can't use MMap.

Note that the documentation for MMap points out that, even if you can modify the file (e.g., on Unix) you need to restart the server whenever the file changes.

share|improve this answer
    
thanks a lot - this is how I thought it would be –  Stephan Sep 15 '11 at 4:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.