Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Feb 1999 12:28:29 +0000
From:      Adam Goryachev <adamg@netlink.co.uk>
To:        perlsta <bright@cygnus.rush.net>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: vm_page_zero_fill
Message-ID:  <36C9646D.4BBB218D@netlink.co.uk>
References:  <Pine.BSF.3.96.990216043855.10060t-100000@cygnus.rush.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi, I have asked this question on freebsd-questions and freebsd-isp (you will
see why in a sec) with absolutely no response. After subscribing to -hackers
yesterday and seeing this message today it seems to answer the why part of my
problem. However, if anyone can suggest a how to fix part then I would be
extremely grateful....

Original question follows:

> OK, I have seen a number of discussions on the mailing list archives regarding
> what Active pages and inactive pages and buf etc all refer to.... but I have a
> slightly different question.
> 
> The way I understand all this is that Inact pages are pages that are
> available, but they need some sort of processing before they can be malloc'ed
> or show up in the Free section.

OK, as I kinda thought but wasn't sure, I guess this is the zero-filling
section...

> Now I have noticed on a rather busy web server that upon startup everything
> flies along smoothly, but the amount in the inactiv section just continues
> increasing.... the only time it truly seems to decrease is when apache is not
> running.
> Also, occasionally, the load average goes right up (sometimes up over 100) and
> a process called pagedaemon is using up all the CPU time... (all in the system
> section). As soon as apache is killed, it's CPU utilisation drops down to 0
> within a minute or two, and restarting apache works fine for another few
> hours....

Since then I've noticed that even if you don't kill apache it does eventually
return to normal, but because we know have two competing processes, apache to
allocate memory and pagedaemon to free it, so it takes a while and they both
run slowly....

> This is running on FreeBSD 2.2.8 with apache 1.3.3
> 
> Top excerpt:
> last pid: 22687;  load averages: 51.05, 57.35, 37.37
> 15:19:57 242 processes: 60 running, 182 sleeping
> CPU states:  4.4% user,  2.2% nice, 92.1% system,  1.3% interrupt,  0.0% idle
> Mem: 140K Active, 364M Inact, 65M Wired, 57M Cache, 8350K Buf, 17M Free
> Swap: 214M Total, 5652K Used, 209M Free, 3% Inuse
> 
>   PID USERNAME PRI NICE SIZE    RES STATE    TIME   WCPU    CPU COMMAND
>     2 root    -18  -5     0K    12K psleep 194:00 86.82% 86.82% pagedaemon
>     4 root     34   0     0K    12K update  55:54  0.50%  0.50% update
> 21894 httpd     2   0 11832K 10380K sbwait   0:01  0.19%  0.19% httpd
> 22191 httpd     2   0 11856K 10404K select   0:00  0.08%  0.08% httpd
> 
> It seems to me that there is supposed to be some sort of cleaning process
> running to move pages from the Inactiv to the Free, (is that what pagedaemon
> does??) but it isn't doing this properly.
> 
> If anyone has any ideas on this, please let me know.
> 
> PS, machine has a total of 512Mb RAM.

Some extra background, the machine was running 2.2.5 until the load increased
to the point where it was crashing (within minutes of bootup) with the (known)
bug regarding pv_entry. Thus the upgrade to 2.2.8 whereupon it started
crashing with different errors. Thus we upgraded the memory to first 384Mb and
then 512Mb whereupon it no longer crashes but http responses aren't as quick
as would be liked and there is the occasional 'cleanup' of memory which slows
things right down....

Any ideas would be greatly appreciated.

PS, basically it also seems as though whenever the machine should start to
swap seriously, it crashes (ie, the case before the memory upgrade on 2.2.8)
has anyone else come up against this problem as well???? 

perlsta wrote:
> 
> On Mon, 15 Feb 1999, Kevin Day wrote:
> 
> > > > I'm currently playing with FreeBSD in an embedded system, where security is
> > My problem is that I have virtually 0 idle time. Any time spent idle is
> > rare, as this is a graphical application, and the faster it runs the better.
> >
> > CPU states: 84.0% user,  0.0% nice, 10.7% system,  5.3% interrupt,  0.0%
> > idle
> 
> Another area you may be interested in investigating is reusing memory, why
> are you forcing the system to give you zero'd pages beyond what it
> normally needs?  Instead of forking and execing you might want to look
> into persistant daemons that use userland memory pools.  If performance is
> SUCH a concern i'm wondering why you aren't already doing this to minimize
> this issue.  Unix offers an incredibly simple and flexible programming
> enviornment, not all of the methods available are effecient, if you abuse
> the ease, don't expect speed.
> 
> Last suggestion, start compiling things with -Wall, find uninitialized
> variable references, report them to a commiter who will tidy things up for
> you.  This isn't really feasable, but it'd be nice to have _someone_ doing
> this. :)
> 
> Why does your graphical application run inetd? :)
> 
> -Alfred
> 
> ( i like my second suggestion, it's what i'd look into )
>

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?36C9646D.4BBB218D>