me@mysunserver:/$ uname -a SunOS mysunserver 5.10 Generic_125100-06 sun4v sparc SUNW,Sun-Fire-T1000 Solaris me@mysunserver:/$ Solaris 10 uses the SunOS 5.10 kernel, Solaris 9 uses the SunOS 5.9 kernel... me@mysunserver:/$ cat /etc/release Solaris 10 11/06 s10s_u3wos_10 SPARC Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms. Assembled 14 November 2006 me@mysunserver:/$
me@mysunserver:/$ showrev Hostname: mysunserver Hostid: 848233a4 Release: 5.10 Kernel architecture: sun4v Application architecture: sparc Hardware provider: Sun_Microsystems Domain: Kernel version: SunOS 5.10 Generic_125100-06 me@mysunserver:/$ Kernel architectures: sun4c (MicroSPARC) sun4d sun4m (SuperSparc) sun4u (UltraSPARC) (~1995) sun4v (USIIIi) (~2002) (Solaris 10 only support sun4u and later)
me@mysunserver:/$ showrev -p Patch: 118367-04 Obsoletes: Requires: Incompatibles: Packages: SUNWcsu Patch: 118371-07 Obsoletes: 119265-02 Requires: Incompatibles: Packages: SUNWcsu, SUNWcsl, SUNWtoo Patch: 118373-01 Obsoletes: Requires: Incompatibles: Packages: SUNWcsu Patch: 118872-04 Obsoletes: Requires: Incompatibles: Packages: SUNWcsu . . .
It is safe to take CPUs (or "cores") out of the multitasking context rotation at any time with "psradm", and can sometimes be a useful trick to check for SMP-based race conditions or for performance analysis and tuning. Let's first check on CPU #6 with "psrinfo": root@mysunserver:~$ psrinfo -v 6 Status of virtual processor 6 as of: 07/26/2007 11:45:30 on-line since 07/26/2007 11:39:55. The sparcv9 processor operates at 1000 MHz, and has a sparcv9 floating point processor. root@mysunserver:~$ Okay, let's go ahead and take it offline (it's safe, really!) root@mysunserver:~$ psradm -f 6 root@mysunserver:~$ Now, if we run "psrinfo" again, it should show as off-line... root@mysunserver:~$ psrinfo -v 6 Status of virtual processor 6 as of: 07/26/2007 11:45:38 off-line since 07/26/2007 11:45:34. The sparcv9 processor operates at 1000 MHz, and has a sparcv9 floating point processor. root@mysunserver:~$ So let's bring it back up: root@mysunserver:~$ psradm -n 6 root@mysunserver:~$ And now it'll show as on-line! root@mysunserver:~$ psrinfo -v 6 Status of virtual processor 6 as of: 07/26/2007 11:46:03 on-line since 07/26/2007 11:45:57. The sparcv9 processor operates at 1000 MHz, and has a sparcv9 floating point processor. root@mysunserver:~$
root@mysunserver:~$ prtdiag | grep Memory Memory size: 2040 Megabytes root@mysunserver:~$ (This machine has 2 gigs.)
root@mysunserver:~$ prtdiag . . .
root@mysunserver:~$ uptime
3:29pm up 7 days 18:13, 1 user, load average: 0.01, 0.01, 0.01
root@mysunserver:~$
^ ^ ^
1 5 15
mysunserver# crontab -eNow add these lines..
# Starting at 8am collect system activity records # every 20 minutes for 12 hours # 20 minutes = 1200 seconds # 12 hours with 3 samples each hour = 36 loops 0 8 * * 1-5 /usr/lib/sa/sa1 1200 36 # After the 12 hour period, # collect a system activity report 30 20 * * 1-5 /usr/lib/sa/sa2 -AAfter a full day of systems monitoring, we can use "sar" to extract the collected data:
root@mysunserver:~$ sar SunOS mysunserver 5.10 Generic_125100-06 sun4v 07/25/2007 23:00:01 %usr %sys %wio %idle 23:20:00 0 0 0 100 23:40:00 0 0 0 100 00:00:00 0 0 0 100 00:20:00 0 0 0 100 00:40:02 0 1 0 99 01:00:01 0 2 0 98 01:20:05 0 2 0 98 . . .In the default SAR display, we see, at every sample interval, how the computer was spending it's time. Each of the four columns shows how the CPU's time was being divided:
# prstat"prstat" will list all the UNIX processes (that it can fit on the screen) in order of which are using the most CPU time first. We can change the sort key "prstat" uses to sort the processes. For example, which processes are using the most memory:
# prstat -s size
psrinfo - Describe CPUs psradm - activate/de-activate CPUs prtdiag - shows amount of RAM on machine, hardware inventory Solaris monitoring mpstat - individual CPU usage vmstat iostat nfsstat - NFS function statistics sar Other: dtrace Solaris debugging: apptrace truss snoop prstat - like 'top' kstat - status variables for all kernel modules kstat -m bge Free Replacement drivers to use on Solaris: ppp
Find an error or omission? Sorry about that! Please e-mail Eric at eric@ericshalov.com and let him know!
All of Eric's Tech Notes are provided on an as-is basis, and may contain
errors or omissions. No statement is made as to thier suitability for
any particular purpose, and no warranty is given. Use at your own risk!
All trademarks are the property of their respective owners.
No duplication of the above information is permitted without prior written
permission of the author(s).
©Copyright 2007 Eric Shalov. All Rights Reserved.