I have 2 web servers that share files over NFS. When we update our php code to a new version, our update script moves the existing directory and copies in the new version in its place. We make the change directly on the NFS server.

Every time we do this, web1 stops working. It gives HTTP 500 errors and the PHP log says it couldn't include fileX.php. However, when if I manually go to the directory in the command line, I can see the file and its the updated version.

In order to fix it, I need to remount the NFS directory and restart apache. Any idea why this is happening? It only happens on web1, not web2 and they both have identical configurations. And, like I said, I can see the files on web1 in the command-line, only apache doesn't see them.

Here are the mount options (/proc/mounts): /var/www nfs rw,sync,noatime,vers=3,rsize=524288,wsize=524288,namlen=255,hard,proto=tcp,port=65535,timeo=600,retrans=2,sec=sys,local_lock=none,addr= 0 0


  • Are the webservers stopped prior to making the change? I can see an issue with shared open files that could lead to a problem like this. – mdpc Jul 20 '11 at 21:33
  • No they are both running. – mhost Jul 20 '11 at 23:07
  • Does the issue go away on its own after 60 seconds? – sciurus Jul 22 '11 at 2:36
  • Actually, it happened again today, but to the other web server (web2). I took it out of the rotation in haproxy because I had limited access today. I just went to try and fix it and I noticed it resolved itself automatically exactly 10 hours and 50 minutes later. – mhost Jul 22 '11 at 7:26
  • Actually, I just realized it fixed itself when my log rotation script ran and restarted apache. – mhost Jul 22 '11 at 7:33

Do an strace on apache.

If its just two servers. Why use NFS. Look at DRBD (Active / Active). I use it and it works like a bomb (You will need OCFS2).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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