Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Nov 1995 10:01:04 +0100 (MET)
From:      J Wunsch <j@uriah.heep.sax.de>
To:        freebsd-hackers@freebsd.org (FreeBSD hackers)
Subject:   Re: That G&*()m process limit
Message-ID:  <199511120901.KAA18566@uriah.heep.sax.de>
In-Reply-To: <14272.816152262@time.cdrom.com> from "Jordan K. Hubbard" at Nov 11, 95 08:57:42 pm

next in thread | previous in thread | raw e-mail | index | archive | help
As Jordan K. Hubbard wrote:
> 
> > With my current 2-CPU setup, fvwm and exmh get launched off a single
> > server, and apparently consume more than 100 child_proc PIDs apiece...
> > 
> > Jordan sets his to 400, maybe the default should be higher than 40?
> 
> No argument from me!

Perhaps it should be made dependant from the machine size (unless
overridden from the config file)?  For my 386sx/16 notebook with its 5
MB of RAM, 40 is certainly the upmost number that could reliably
prevent a ``while (fork()) ;'' from making the machine unoperable.

So what about:

	switch(cpu_class) {
	case CPUCLASS_286:
		printf("What the heck are you doing here?\n");
		exit(1);
		/* or does somebody know why CPUCLASS_286 is still there? */

	case CPUCLASS_386:
		proclimit = 20;
		break;

	case CPUCLASS_486:
		proclimit = 40;
		break;

	case CPUCLASS_586:
		proclimit = 50;
		break;
	}

	i = ptoa(Maxmem) / (4 * 1024 * 1024);

	/* calculate int(log2(i)) */
	for(j = 31; j >= 0; j--) {
		if(i & (1 << j))
			break;
	}

	proclimit *= (j + 1);


This would yield:

CPU & maxmem: 386 2	:-)
Your proclimit is 20
CPU & maxmem: 386 4
Your proclimit is 20
CPU & maxmem: 386 8
Your proclimit is 40
CPU & maxmem: 486 4
Your proclimit is 40
CPU & maxmem: 486 8
Your proclimit is 80
CPU & maxmem: 386 12
Your proclimit is 40
CPU & maxmem: 486 16
Your proclimit is 120
CPU & maxmem: 586 8
Your proclimit is 100
CPU & maxmem: 586 16
Your proclimit is 150
CPU & maxmem: 586 64
Your proclimit is 250
CPU & maxmem: 486 128
Your proclimit is 240
CPU & maxmem: ^C

I believe these are realistic defaults.
	
-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199511120901.KAA18566>