
in /etc/system

	#SumOfThroughputRateOfAllSwapDisks = (disk speed)/(# of I/O for page out)
	set maxpgio=1024        #doc says max 1024, but can by 8192
	set slowscan=500        #default 100

	set scsi_options=0x3f8
	set scsi_options & ~0x80

	set sd:sd_max_throttle=10 
 
	#
	#below values should match: maxphys and scsi driver.conf entry
	#
	set maxphys=0x400000  #4MB size for max single I/O chunk size

	sd.conf #scsi disk
		#add at top of file
		sd_max_xfer_size=0x400000;

	ssd.conf #fiber channel disk
		#add at top of file
		ssd_max_xfer_size=0x400000;

	st.conf  #scsi tape
		#add at top of file
		ssd_max_xfer_size=0x400000;


	set tcp:tcp_conn_hash_size=8192

you can see both: sysdef -i | grep bufhwm (output in hex)
	*64K
	set bufhwm=10000
	set maxusers=2048

	/*pre solaris 2.8*/
		set npty=176 /*max is 176*/
		set pt_cnt=2048

	/*kernel debug for watchdogs*/
	forceload: misc/obpsym
	set nopanicdebug=1
	forceload: misc/obpsym
	set nopanicdebug=1


	#set ncsize=5000
	#set ufs_ninode=10000
	#set fastscan=8192      #default (physmem/4), max 131072
	#set handspreadpages=   #default is null, should = fastscan 

Filesystem
	segmap_percent #want it from 12 to 50 of physical memory, replaces priority_paging 

    kstat -n segmap
		Estimate hit rate as (get_reclaim+get_use) / getmap

	use filebench to do benchmarking


if nfs server
	change /etc/rc2.d/nfs.server: nfsd 16 
	       echo \$<threadlist |mdb -k |grep svc_run |wc -l

	       /etc/default/nfs: NFSD_SERVERS=16 
		   pstack `pgrep nfsd` | grep nfssys |wc -l
			to
				nfsd 1024
				nfsd -a -c 1024 1024

	nfsstat -m
	nfsstat -z

openfiles: you can see what this is set to with ulimit -n command
    you can see both: sysdef | grep "file descriptor" 
	                    (output in hex: cur/min(soft)|max(hard))

	set rlim_fd_cur=512   #256 default (100)
	set rlim_fd_max=2048  #1024 default (400)


in /etc/init.d/inetinit at end (run: nddconfig show)

/usr/sbin/ndd -set /dev/tcp tcp_slow_start_initial 2
/usr/sbin/ndd -set /dev/tcp tcp_xmit_hiwat  65536
/usr/sbin/ndd -set /dev/tcp tcp_recv_hiwat  65536
/usr/sbin/ndd -set /dev/tcp tcp_conn_req_max_q0 4096
/usr/sbin/ndd -set /dev/tcp tcp_conn_req_max_q 1024
/usr/sbin/ndd -set /dev/tcp tcp_rexmit_interval_min  3000
/usr/sbin/ndd -set /dev/tcp tcp_rexmit_interval_max  10000
/usr/sbin/ndd -set /dev/tcp tcp_keepalive_interval 300000
/usr/sbin/ndd -set /dev/tcp tcp_ip_abort_interval    60000
#obsolete,next line: /usr/sbin/ndd -set /dev/tcp tcp_close_wait_interval 1000
/usr/sbin/ndd -set /dev/tcp tcp_time_wait_interval 1000

#/usr/sbin/ndd -set /dev/tcp tcp_old_urp_interpretation 1
#/usr/sbin/ndd -set /dev/tcp tcp_conn_hash 8192
#/usr/sbin/ndd -set /dev/tcp tcp_conn_hash_size 8192
#/usr/sbin/ndd -set /dev/tcp tcp_conn_req_max 1024

/usr/ccs/bin/nm /kernel/genunix /platform/sun4u/kernel/unix

modify current kernel
	/usr/bin/isainfo -kv # see if 32 or 64 bit

	adb -kw /dev/ksyms /dev/mem

	if 32,	64 bit
	D	E
	X	J
	W	Z

	D - long decimal
	E - 8 bytes unsigned
	X - 4 bytes hex
	J - 8 byes hex
	W - write 4-byte to address
	Z - write 8-byte to address

	VAR/W 0txxxxx
		lotsfree/W 0txxxxx
		lotsfree/D
				output of value


processes:  ps -cafel
			prstat -a
			har -r 1 3
            sdtprocess

            se pea.se
            se peac.se
            se peer.se
            se pry.se
            se ps-ax.se
            se ps-p.se
            se pwatch.se

iostat -xtnc     #perf
iostat -xnp
iostat -DMnpxz   #perf
iostat -Een      #disk types

se disks.se

vmstat -s  #summary
vmstat -S  #swap
vmstat -p  #page
vmstat -c  #cache stats
vmstat -i  #clock ticks
lockstat sleep 5  
lockstat -H -D 10 sleep 1
lockstat -H -f tcp_rput_data -s 50 -D 10 sleep 1
lockstat -kIW -D 20 ./polltest
lockstat -kgIW -D 20 ./polltest
	modinfo | grep sbus
		24 102a8b6f   b8b4  59   1  sbus (SBus (sysio) nexus driver)
	lockstat -kICE -f 0x102a8b6f,0xb8b4 sleep 10
lockstat -Iw -l cpu[3] ./testprog
kstat -p  
kstat -n vm
netstat -k 
netstat -s 
sar -A 
uptime 
mpstat
cpustat -c IC_ref,IC_hit -c Cycle_cnt,Instr_cnt 1 3
cputrack -T 0 -fve -c Cycle_cnt,Instr_cnt sh -c date
trapstat -t 1 111
trapstat -T 1     # if %tim is over 30%, use large pages

busstat DEVICE

vmstat -p
prstat -J 
prstat -Z
prstat -t
cpustat 
cputrack
busstat
apptrace
lockstat
kstat
sar (change cron (sys) for more intervals - 5 or 10 versus 20m) and svcadm enable sar
iostat -xnz 5
nfsstat
trapstat
iosnoop
iotop
iotrace.d
iowait.d
netstat -i
netstat -s
netstat -k
tcptop.d
tcpsnoop.d
/usr/sfw/bin/snmpnetstat -v1 -c public -i localhost
pagesize
prtconf
sysdef
swap -l

ap -s
trapstat -T 5
trapstat -t 1 200

kstat -n dnlcstats
kstat -n system_pages
kstat -n unix::system_pages
kstat -n vm
kstat -m tcp
kstat -m ip

se toolkit: se nx.se 1 nicstat
memtool: prtswap -l , prtswap, prtmem


echo "map kernelmap" | /usr/sbin/crash 
echo kmastat | /usr/sbin/crash 

cpustat -c pic0=Cycle_cnt,pic1=DTLB_miss 1   #sol 8 TLB miss

pagesize
pagesize -a
ppgsz   #set pagesize
 ppgsz -o heap=4M,stack=512K -p `pgrep -u ora '^ora'`
 ppgsz -o anon=512k -p 953
 ppgsz -o heap=4M ./testprog
 pmap -sx `pgrep testprog`

 sol9# LD_PRELOAD=$LD_PRELOAD:mpss.so.1
 sol9# export LD_PRELOAD=$LD_PRELOAD:mpss.so.1
 sol9# export MPSSHEAP=4M
 sol9# ./testprog
 MPSSHEAP=size
 MPSSSTACK=size
 MPSSHEAP and MPSSSTACK specify the preferred page
 sizes for the heap and stack, respectively. The specified
 page size(s) are applied to all created
 processes.
 MPSSCFGFILE=config-file
 config-file is a text file which contains one or more
 mpss configuration entries of the form:
 exec-name:heap-size:stack-size

se zoom.se
/opt/RICHPse/toptool/toptool
/opt/RICHPse/perfmon/perfmon


vxinfo
vxstat
vxprivutil
To gather data:  
	vxtrace -d /tmp/trace1 -o dev,disk /dev/vx/dsk/dg/vol
To review data:  
	vxtrace -f /tmp/trace1 -o dev,disk vol03 | more
	iostat -xtczM <disk> 1 100   (where <disk> = sd# ; 1 = interval ; 100 = count)
	vxfsstat -bczi -c 1 -t 100 /mntpoint 
	vxstat -g <diskgroup> -r		(to reset statistics)
	vxstat -g <diskgroup> -dvps -i 1 -c 100  > vxstat.out
You can verify  that you have no disabled paths by reviewing the output of:
	vxdmpadm getsubpaths ctlr=cX


Memory
	prtconf | grep Meg  #physical memory
	sar -k 1 1          #kernel memory
	vmstat 3 3          #free memory

	mdb -k              #page statistics - wait a while...
		::memstat
	^d

	echo "max_nprocs/D" | mdb -k              #kernel proc table

	mdb -k              #page statistics - wait a while...
		::ps
		.....
		>----hex-----::proc_t
	^d

fsflush use too much CPU on Solaris 8
 Set autoup in /etc/system
 Symptom is one CPU using 100%sys
Corrective Action
 Default is 30s, recommend setting larger
 e.g. 10x nGB of memory
