Re: pre-patch-2.0.31-2 + werners buffer patch

Mark Hemment (markhe@sco.COM)
Thu, 17 Jul 1997 15:22:32 +0100 (BST)


Hi,

On Thu, 17 Jul 1997, Miquel van Smoorenburg wrote:
> According to Dr. Werner Fink:
> > > We've tried running pre-patch-2.0.31-2 + werners buffer patch (11 July) on our
> > > news machine. It crashes every night at expire time.. when we're not there
> > > to have a look.
> > Do you have more infomation on the affected system?
> Last night it crashed again, and rebooted through the watchdog. I installed
> a script that ran every minute and did a "ps". Here's what was running
> just before the machine died:
> # free
> total used free shared buffers cached
> Mem: 63360 62844 516 8440 520 2956
> -/+ buffers: 59368 3992
> Swap: 98524 79016 19508
> # ps auxww
> USER PID %CPU %MEM VSZ RSS TT STAT START TIME COMMAND
> news 21924 5.4 82.5 145M8 52276 ? D 02:10 2:44 expireover -z /var/l
> og/news/expire.rm.20784

Definitely remove the ".age = 2*PAGE_INITIAL_AGE);" lines from Dr.
Werner's patch if you haven't already done so (he did post about this, so
I guess you've done it already). Otherwise the system will find it
hard to remove re-loaded anonymous pages from core.

expireover(8) does seems to be large, and have a lot of pages in core.
This is probably a result of the '-z' option.

I don't run a news-server, but I've just pulled down the source to
inn1.4-sec to have a quick look at expireover(8). It appears pretty good
at re-using it's malloc(3)ed memory, but uses more if the '-z' is given
(to create a list, which is realloc(3)ed as necessary.).
Also, '-z' causes a call to qsort(3) which also uses more memory and has
a memory access pattern which can cause heavy anonymous page I/O when
memory is short (the Working-Set has a high rate of change).
(Note: I know qsort(3) uses an alternative algorithm if it's malloc(3)
fails, but in reality the malloc(3) rarely fails. This is not the issue
here).

Try running expireover(8) without '-z'. For a "plenty-of-memory"
situation, '-z' would be faster. But on a system that does not have
enough physical memory performance should be better without it less
paging to/from swap. This is a guess, but it seems to make sense...

Regards,

markhe

-----------------------------------------------------
Mark Hemment UNIX/C Software Engineer (contractor)
"Success has many fathers. Failure is a b**tard"
-----------------------------------------------------