Date: Sat, 31 Jan 1998 06:02:27 -0500 From: Geoffrey Robinson <grobin@accessv.com> To: dg@root.com Cc: questions@FreeBSD.ORG Subject: Re: Something is very wrong. Memory leak? Message-ID: <34D304C3.DA84504D@accessv.com> References: <199801311016.CAA16970@implode.root.com>
next in thread | previous in thread | raw e-mail | index | archive | help
David Greenman wrote: > > >I'm running a FreeBSD 2.2.5RELEASE server using Apache 1.3a1 on a P-200 > >with 128MB RAM that gets 80k to 100k hits a day and I seem to be > >experiencing a serious memory problem. > > > >When the server boots I have about 109MB free memory. As time goes by > >the free memory slowly disappears at the rate of about 40MB a day. Most > >of the missing memory is listed under active in top but the sum of > >memory used by the process isn't anywhere near that much. > > > >And it gets worse... > > > >If I don't reboot every two days and the free memory gets below 15MB the > >systems seems to go into a sort of 'dormant' state. It stops processing > >requests from the web and telnet becomes very slow even though the load > >average is below 0.2. Luckily I am still able to reboot when it is in > >this state. > > > >I've been very careful about rebooting regularly so this 'dormant' state > >has only occurred twice, but it seems to be directly related to the loss > >of memory. > > > >The server was installed from the same FreeBSD CD that I installed on my > >home system, but I haven't had any memory problems at home. > > > >Dose anybody know what is going on? > > "Free memory" is memory that is completely unused and contains no useful > data. As the system runs and files are accessed, the file data is cached > and is no longer "free". It will then show up in the statistics of 'active', > 'inactive', and 'cached'. > I suspect your problem is caused by running out of networking buffers > (mbuf clusters). If you haven't specifically tuned this on your system, then > this is likely. You can increase the number of buffers by either increasing > the value of "maxusers" in the kernel config file, or by adding: > > options "NMBCLUSTERS=<n>" > > ...where <n> is something like 4000. I would suggest that you do both > of these - set maxusers to at least 64, and NMBCLUSTERS to 4000. > I have NMBCLUSTERS set to 4096 and maxuses set to 500. Do I have to have NMBCLUSTERS=4096 in quotation marks? This is what I have right now. machine "i386" #cpu "I386_CPU" #cpu "I486_CPU" cpu "I586_CPU" #cpu "I686_CPU" ident "DATAIS1" maxusers 500 options NMBCLUSTERS=4096 #mbuf clusters options CHILD_MAX=1000 #Max # child processes options OPEN_MAX=1000 #Max fds I based these setting on the Apache document _Running a High-Performance Web Server for BSD_.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?34D304C3.DA84504D>