You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Dean Gaudet <dg...@arctic.org> on 1999/03/16 05:30:09 UTC

mmap and freebsd 2.2.x

Looks like freebsd 2.2.x shouldn't define USE_MMAP_FILES. 

Dean

---------- Forwarded message ----------
> On Mon, 15 Mar 1999, Matthew H. North wrote:
> 
> > Something else that may be of interest to you:  we also had problems using
> > USE_MMAP_FILES.  We were experiencing httpd processes that would 'stick' in a
> > 'D'isk access in the kernel, with 'nfsvin' listed (by top) as the state of
> > such processes.  When this happened, these processes would not die, nor could
> > they be killed (-9).  The server would eventually have to be restarted since
> > these stuck processes would use up system resources.  We determined (we
> > think) that the problem was due to the fact that we have our DocumentRoots
> > nfs mounted from another machine.  FreeBSD2.2.x apparently has some problem
> > making mmap work with nfs mounted file systems.  We have since recompiled
> > 1.3.4 with USE_MMAP_FILES UNdefined, and we are watching the server to see if
> > that indeed solves the problem.  As of right now, *none* of the httpd
> > processes are stuck in this 'nfsvin' state.  We went back and checked the
> > 1.2.6 code (since 1.2.6 doesn't have this problem), and it appears that 1.2.6
> > doesn't use mmap except for the scoreboard.
> > 
> > Matthew H. North
> > CTSNET Assistant Administrator
> >    ___  ____  ___
> >   /      /   /__   Network | Tel 619/637-3600 | Mail: ctsmhn@cts.com
> >  /__    /   ___/  Services | Fax 619/637-3630 | WWW: http://www.cts.com
> > 
> > 
> 
> 



Re: mmap and freebsd 2.2.x

Posted by Cliff Skolnick <cl...@steam.com>.
I was bored...  Here's a bit of code that will check to see if a FreeBSD
machine has any remote file systems mounted.  I suggest on startup this code
will run on any FreeBSD machine with USE_MMAP_FILES defined and print a
warning that results may be unstable if documents are being served from NFS
mounted partitions.  It's pretty BSD specific code, but I think this is a
BSD specific issue.  I'd prefer to let others decide if this code is a good
idea and where it should go.

Cliff


#include <sys/param.h>
#include <sys/ucred.h>
#include <sys/mount.h>

#define MAX_FILESYSTEM_MOUNTS 32

main()
{
  struct statfs statbuf[MAX_FILESYSTEM_MOUNTS];
  int st;

  if ((st = getfsstat(statbuf, MAX_FILESYSTEM_MOUNTS * sizeof(struct statfs),
       MNT_WAIT)) != -1) {
    while (st-- > 0) {
      if ((statbuf[st].f_flags & MNT_LOCAL) == 0) {
        printf("type %s on %s\n", statbuf[st].f_fstypename, statbuf[st].f_mntonname);
      }
    }
  } else {
    perror("getfsstat()");
  }

  return st;
}


On Mon, 15 Mar 1999, Brian Behlendorf wrote:

> 
> It works fine for me, but I don't use NFS.  Do we have a platform-specific
> hints file somewhere we could warn people about this?  How much does it
> hurt performance to not mmap files?  
> 
> 	Brian
> 
> On Mon, 15 Mar 1999, Dean Gaudet wrote:
> > Looks like freebsd 2.2.x shouldn't define USE_MMAP_FILES. 
> > 
> > Dean
> > 
> > ---------- Forwarded message ----------
> > > On Mon, 15 Mar 1999, Matthew H. North wrote:
> > > 
> > > > Something else that may be of interest to you:  we also had problems using
> > > > USE_MMAP_FILES.  We were experiencing httpd processes that would 'stick' in a
> > > > 'D'isk access in the kernel, with 'nfsvin' listed (by top) as the state of
> > > > such processes.  When this happened, these processes would not die, nor could
> > > > they be killed (-9).  The server would eventually have to be restarted since
> > > > these stuck processes would use up system resources.  We determined (we
> > > > think) that the problem was due to the fact that we have our DocumentRoots
> > > > nfs mounted from another machine.  FreeBSD2.2.x apparently has some problem
> > > > making mmap work with nfs mounted file systems.  We have since recompiled
> > > > 1.3.4 with USE_MMAP_FILES UNdefined, and we are watching the server to see if
> > > > that indeed solves the problem.  As of right now, *none* of the httpd
> > > > processes are stuck in this 'nfsvin' state.  We went back and checked the
> > > > 1.2.6 code (since 1.2.6 doesn't have this problem), and it appears that 1.2.6
> > > > doesn't use mmap except for the scoreboard.
> > > > 
> > > > Matthew H. North
> > > > CTSNET Assistant Administrator
> > > >    ___  ____  ___
> > > >   /      /   /__   Network | Tel 619/637-3600 | Mail: ctsmhn@cts.com
> > > >  /__    /   ___/  Services | Fax 619/637-3630 | WWW: http://www.cts.com
> > > > 
> > > > 
> > > 
> > > 
> > 
> > 
> 

--
Cliff Skolnick
Steam Tunnel Operations
cliff@steam.com
http://www.steam.com/


Re: mmap and freebsd 2.2.x

Posted by Brian Behlendorf <br...@hyperreal.org>.
It works fine for me, but I don't use NFS.  Do we have a platform-specific
hints file somewhere we could warn people about this?  How much does it
hurt performance to not mmap files?  

	Brian

On Mon, 15 Mar 1999, Dean Gaudet wrote:
> Looks like freebsd 2.2.x shouldn't define USE_MMAP_FILES. 
> 
> Dean
> 
> ---------- Forwarded message ----------
> > On Mon, 15 Mar 1999, Matthew H. North wrote:
> > 
> > > Something else that may be of interest to you:  we also had problems using
> > > USE_MMAP_FILES.  We were experiencing httpd processes that would 'stick' in a
> > > 'D'isk access in the kernel, with 'nfsvin' listed (by top) as the state of
> > > such processes.  When this happened, these processes would not die, nor could
> > > they be killed (-9).  The server would eventually have to be restarted since
> > > these stuck processes would use up system resources.  We determined (we
> > > think) that the problem was due to the fact that we have our DocumentRoots
> > > nfs mounted from another machine.  FreeBSD2.2.x apparently has some problem
> > > making mmap work with nfs mounted file systems.  We have since recompiled
> > > 1.3.4 with USE_MMAP_FILES UNdefined, and we are watching the server to see if
> > > that indeed solves the problem.  As of right now, *none* of the httpd
> > > processes are stuck in this 'nfsvin' state.  We went back and checked the
> > > 1.2.6 code (since 1.2.6 doesn't have this problem), and it appears that 1.2.6
> > > doesn't use mmap except for the scoreboard.
> > > 
> > > Matthew H. North
> > > CTSNET Assistant Administrator
> > >    ___  ____  ___
> > >   /      /   /__   Network | Tel 619/637-3600 | Mail: ctsmhn@cts.com
> > >  /__    /   ___/  Services | Fax 619/637-3630 | WWW: http://www.cts.com
> > > 
> > > 
> > 
> > 
> 
> 


Re: mmap and freebsd 2.2.x

Posted by Cliff Skolnick <cl...@steam.com>.
This is also reasonable to turn off USE_MMAP_FILES for 3.x where I have seen
some NFS problems for heavily used file systems.  Might be better to
document since I think the minority of users use apache over NFS.  Perhaps a
runtime warning upon start if any DocumentRoot or UserDir (this one might be
hard to detect) file systems are NFS mounted and USE_MMAP_FILES is defined?

Cliff

On Mon, 15 Mar 1999, Dean Gaudet wrote:

> Looks like freebsd 2.2.x shouldn't define USE_MMAP_FILES. 
> 
> Dean
> 
> ---------- Forwarded message ----------
> > On Mon, 15 Mar 1999, Matthew H. North wrote:
> > 
> > > Something else that may be of interest to you:  we also had problems using
> > > USE_MMAP_FILES.  We were experiencing httpd processes that would 'stick' in a
> > > 'D'isk access in the kernel, with 'nfsvin' listed (by top) as the state of
> > > such processes.  When this happened, these processes would not die, nor could
> > > they be killed (-9).  The server would eventually have to be restarted since
> > > these stuck processes would use up system resources.  We determined (we
> > > think) that the problem was due to the fact that we have our DocumentRoots
> > > nfs mounted from another machine.  FreeBSD2.2.x apparently has some problem
> > > making mmap work with nfs mounted file systems.  We have since recompiled
> > > 1.3.4 with USE_MMAP_FILES UNdefined, and we are watching the server to see if
> > > that indeed solves the problem.  As of right now, *none* of the httpd
> > > processes are stuck in this 'nfsvin' state.  We went back and checked the
> > > 1.2.6 code (since 1.2.6 doesn't have this problem), and it appears that 1.2.6
> > > doesn't use mmap except for the scoreboard.
> > > 
> > > Matthew H. North
> > > CTSNET Assistant Administrator
> > >    ___  ____  ___
> > >   /      /   /__   Network | Tel 619/637-3600 | Mail: ctsmhn@cts.com
> > >  /__    /   ___/  Services | Fax 619/637-3630 | WWW: http://www.cts.com
> > > 
> > > 
> > 
> > 
> 
> 

--
Cliff Skolnick
Steam Tunnel Operations
cliff@steam.com
http://www.steam.com/