From owner-freebsd-questions Sat Jan 31 03:05:52 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id DAA27011 for questions-outgoing; Sat, 31 Jan 1998 03:05:52 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from emerald.accessv.com (emerald.accessv.com [206.221.248.8]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id DAA26917 for ; Sat, 31 Jan 1998 03:04:47 -0800 (PST) (envelope-from grobin@accessv.com) Received: from accessv.com (port006-86.accessv.com [209.50.86.6]) by emerald.accessv.com (8.8.5/8.8.5) with ESMTP id GAA23714; Sat, 31 Jan 1998 06:01:22 -0500 Message-ID: <34D304C3.DA84504D@accessv.com> Date: Sat, 31 Jan 1998 06:02:27 -0500 From: Geoffrey Robinson Reply-To: grobin@accessv.com X-Mailer: Mozilla 4.03 [en] (Win95; U) MIME-Version: 1.0 To: dg@root.com CC: questions@FreeBSD.ORG Subject: Re: Something is very wrong. Memory leak? References: <199801311016.CAA16970@implode.root.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG X-To-Unsubscribe: mail to majordomo@FreeBSD.org "unsubscribe questions" 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=" > > ...where 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_.