Subject: Issue with large memory systems, and PPC overhead
To: port-macppc@netbsd.org, <tech-kern@netbsd.org>
From: John Klos <john@sixgirls.org>
List: tech-kern
Date: 11/02/2002 19:14:56
Hi,

I have a PowerMac 9600 with 1.5 gigs of memory. I've made a kernel with
maxusers set to 256; my maxproc is 4116 (256 * 16 + 20). However, I cannot
seem to launch more than 1,800 - 2,000 tasks. I get "cannot fork"
messages.

Note that I do not necessarily think I will ever need to run that many
tasks, but I'd like to have the system configured so that maxproc is
somewhat close to what the system will actually be able to run; it seems
that the code that calculates some of the values from maxusers is not set
up to scale well - after all, we still get warnings when maxusers > 64,
even though a 512 meg DIMM costs about $50 USD.

Does anyone have guidelines / suggestions / recommendations for
configuring a kernel for large memory systems?

Another thing: fork overhead. I ran the following script on 1,260 numbers
on several machines, and noticed that there is a large discrepency that is
not explained by processor performance.

#!/bin/sh
total=0
for number in `cat test`
do
  total=`echo $total"+"$number | bc`
  echo $total
done

(No, I'd never use this in real life - awk is much quicker. Also note
that the times below are user times, as these systems are heavily used)

Why is it that it seems that forking on PowerPC has so much overhead?
68060, 66 MHz:  38.3 seconds,  33 per second,    .5 per second per MHz
603e, 200 Mhz:  27.24 seconds, 46.25 per second, .23 per second per MHz
604ev, 350 MHz: 14.3 seconds,  88 per second,    .25 per second per MHz
G3, 300 MHz:    13.5 seconds,  93.3 per second,  .31 per second per MHz
P3, 550 MHz:    1.93 seconds,  652 per second,   1.19 per second per MHz

Does anyone care to guess why this is? I suppose part of it could be
explained by memory bus speed - the 68060 is on a 64 bit memory bus, and
each PowerPC listed has progressively faster memory (and cache), but I
don't thing that memory alone could explain a fourfold difference in
efficiency between PowerPC and i386.

Thanks,
John Klos
Sixgirls Computing Labs