[rescue] sparc10 cpu - what to do.

Sandwich Maker adh at an.bradford.ma.us
Sat Dec 17 16:49:13 CST 2016


" From: Dave McGuire <mcguire at neurotica.com>
" 
" On 12/17/2016 11:00 AM, Sandwich Maker wrote:
" > now that my memory is prodded, i have a little sunos kernel tuner shell
" > script i wrote according to an old sun performance overview article.
" > sunos came out when memory was expensive and most machines had what
" > we'd consider really tiny amounts of ram; only really bulky machines
" > like db servers et al had anything like what we'd consider normal now.
" 
"   I dunno about that, man.  I'd consider 32GB-64GB to be normal now, and
" the last big Oracle server that I ran under SunOS was on an SS20 with, I
" think, 384MB of RAM, in about 1996. ;)

the first ss10 i saw - about '91 - shipped with 16M.  my ss2 came with
4M, or maybe less.  okay, 384M is also small by today's rules, but
16M?  cpus have more cache than that now.

" > the sunos kernel was optimized for memory in the single-digits of MB.
" > the script calculates and resets several variables in either kmem,
" > vmunix, or both.  it can be run on a running machine.  i don't know if
" > you'll get a perceptible, or even measurable, speedup.
" 
"   Most of these are calculated from the kernel build tunable MAXUSERS,
" usually right near the top of a BSD kernel configuration file.  That
" variable set the sizes of a great many things in a kernel built from
" that config file.  I think most of those tunables you're talking about
" are the runtime-settable subset of those, and yes, they can have a
" profound and visible impact on overall system performance.

solaris has this, or something like it, but iirc sunos didn't.  in any
event, sun performance overview was a sun publication, and i don't
think they'd've bothered to publish the article i used if there was an
easier, more obvious way.  iirc the author was a sun employee whose
job was thinking about kernel performance.

" > i also have a ksh function which assists in calculating disk partition
" > tables for the cylinder-boundary metaphor, still needed as late as s8
" > but really obsolete in the zbr era.  have late-model solarii given up 
" > on it yet?
" > 
" > anyone interested in them?
" 
"   I'm interested.  The new exhibit floor is going to have a lot of early
" Sun hardware running, and the majority of it will be running SunOS.

here they are, with notes following.


sktune:
========================================%<-----------------------------
#!/bin/sh
######################
# 19950629 adh at an.bradford.ma.us
######################
# taken out of SunPerfOvDec93
######################

# defaults
# tunes a 128M, 2*5411rpm disk system
RAM=128 DISKS=2 SPEED=5411	# 128M ram, 2 seagate hawk 4G disks
KERN=true MEM=true

# process options here
# -r ram, -d disks [with swap] -s speed [of swap disks]

while getopts r:d:s:km OPTION
do
	case $OPTION in
	r)	RAM=$OPTARG	;;
	d)	DISKS=$OPTARG	;;
	s)	SPEED=$OPTARG	;;
	k)	MEM=false	;;
	m)	KERN=false	;;
	\?)	echo $0: error!  unknown option $OPTARG!; exit 1;;
	esac
done
shift `expr $OPTIND - 1`

FASTSCAN=`expr $RAM \* 64`
LOTSFREE=`expr $RAM \* 8`
MAXPGIO=`expr $SPEED \* $DISKS / 90`

# change /vmunix
$KERN &&
{
echo "tuning /vmunix..."
adb -k -w /vmunix /dev/mem <<--
fastscan?W0t${FASTSCAN}
lotsfree?W0t${LOTSFREE}
maxpgio?W0t${MAXPGIO}
maxslp?W0x80
#udp_cksum?W1	#to enable udp checksums
-
}

# change /dev/mem
$MEM &&
{
echo "tuning /dev/mem..."
adb -k -w /vmunix /dev/mem <<--
fastscan/W0t${FASTSCAN}
lotsfree/W0t${LOTSFREE}
maxslp/W0x80
#udp_cksum/W1	#to enable udp checksums
-
}
----------------------------<%========================================
nb. udp_cksum is commented out because you can't use it if you also
have a firewall such as ipfilter.  i think it let the kernel use
network h/w for the calc.

it disables swapping, which is worse than useless when you also have
paging.

of course, tuning mem affects only the running system while tuning
vmunix makes the settings permanent - until you recompile the kernel.


pt:
========================================%<-----------------------------
typeset -i HEAD=0 TOTB=0 BTRK=0
function pt
{
	typeset -i MEGS=0 BLKS=0 CYLS=0 SCYL=0 RB=0 KTRK=0

	while getopts :h:b:k:t: OPTION
	do
		case $OPTION in
		h)	HEAD=$OPTARG;;
		b)	BTRK=$OPTARG;;
		k)	KTRK=$OPTARG;;
		t)	TOTB=$OPTARG;;
		':')	print -u2 "$0: $OPTARG requires an argument";;
		'?')	print -u2 "$0: $OPTARG is unknown\nUSAGE: $0 -h heads [-b blocks/track | -k Kb/track] -t total_blocks partitions_in_Mb"; return 1;;
		esac
	done
	shift $((OPTIND - 1))

	(( KTRK )) && BTRK=$((KTRK*2))

	print "$HEAD heads, $((BTRK/2)) Kb/track"

	for MEGS in "$@"
	do
		CYLS=$((2048*MEGS/HEAD/BTRK))
		BLKS=$((CYLS*HEAD*BTRK))
		(( RB += BLKS ))
		print "partition =	$SCYL,	$BLKS	[actual size $CYLS cyls,	$((CYLS*HEAD*BTRK/2048)) meg]"
		(( SCYL += CYLS ))
	done
	print "partition =	$SCYL,	$((TOTB - RB))	[actual size $((TOTB/BTRK/HEAD - SCYL)) cyls,	$(((TOTB - SCYL*HEAD*BTRK)/2048)) meg]"
}
----------------------------<%========================================
this takes disk params as opts and slices as args and prints the
largest partitions that will fit under those sizes as
starting cyl, size in blocks,
with a final entry for any leftover space.
example:
% pt -h 19 -b 71 -t 8386733 1024 512 512 2048
19 heads, 35.5 Kb/track
partition =     0,      2096346 [actual size 1554 cyls, 1023.6064453125 meg]
partition =     1554,   1048173 [actual size 777 cyls,  511.80322265625 meg]
partition =     2331,   1048173 [actual size 777 cyls,  511.80322265625 meg]
partition =     3108,   4194041 [actual size 3109 cyls, 2047.87158203125 meg]
partition =     6217,   0       [actual size 0 cyls,    0 meg]

note also that the option variables are defined *outside* the
function.  the shell will remember them so that once given they need
not be specified on subsequent invocations unless you want to change
them.

i should also add that when i wrote it i was using ksh88 compiled from
src with the FLOAT option enabled.  by default it isn't, but ksh93
[and its child dtksh] supports floats but need pt to be recoded
slightly; typesets -i really are ints; -E and -F are floats.
________________________________________________________________________
Andrew Hay                                  the genius nature
internet rambler                            is to see what all have seen
adh at an.bradford.ma.us                       and think what none thought


More information about the rescue mailing list