hp education services education.hp.com 67 cpu management version b.02 h4262s module 5 slides
TRANSCRIPT
1
hp education services
education.hp.com
CPU Management
Version B.02H4262S Module 5 Slides
2 © 2001 Hewlett-Packard Company
H4262S B.02
Processor Module
CPU
TLB Cache Coprocessor
System Bus
3 © 2001 Hewlett-Packard Company
H4262S B.02
Symmetric Multiprocessing
CPU
TLB Cache Coprocessor
CPU
TLB Cache Coprocessor
System Bus
4 © 2001 Hewlett-Packard Company
H4262S B.02
CPU Processor
CPU
TLB Cache Coprocessor
ShadowRegisters
SpaceRegisters
GeneralRegisters
ControlRegisters
Process Status Word
InstructionAddress Queues
Special FunctionUnitRegisters
CoprocessorRegisters
5 © 2001 Hewlett-Packard Company
H4262S B.02
CPU Cache
CPU
TLB Cache Coprocessor
System Bus
Memory
ProcessText
xxxx
Instructionto Execute
xxxx
6 © 2001 Hewlett-Packard Company
H4262S B.02
TLB Cache
CPU
TLB Cache Coprocessor
System Bus
Memory
ProcessText
xxxx
Instructionto Execute
xxxxVA | PA
0...4GB
InstructionAddress Queues
VA\PA
7 © 2001 Hewlett-Packard Company
H4262S B.02
TLB, Cache, and Memory
TLB
Hit
Hit
Miss
Miss
Cache
Hit
Miss
X
X
Memory
Hit
Hit
Hit
Miss
Consequence
1 CPU cycle fetch
Data/instructionmemory fetch
PDIR memory fetch
Page fault
X = Don’t Care
8 © 2001 Hewlett-Packard Company
H4262S B.02
HP-UX 11.00 — Performance Optimized Page Sizes (POPS)
Filesystem
File
Filesystem
FileMemory
MemoryTLB (on CPU)
TLB (on CPU)
0 819216384 512000
VA PA
0 8192 4096 65536 8192 12800012288 25600016384 512000
VA PA
VA 0 4096 81921228816384
VA 0
16384
0
8192
65536
128000
256000
512000
0
8192
512000
HP-UX 10.x
Fixed PageSize – 4 KB
HP-UX 11.00
Variable PageSize Range: 4 KB – 64 MB
9 © 2001 Hewlett-Packard Company
H4262S B.02
CPU — Metrics to Monitor Systemwide
• User CPU utilization
• System CPU utilization
• Idle CPU utilization
• Nice utilization
• System call rate
• Context switch rate
• Real time processes
• CPU run queues (load averages)
10 © 2001 Hewlett-Packard Company
H4262S B.02
CPU — Metrics to Monitor per Process
• Process priority
• Process nice value
• Amount of CPU user time
• Amount of CPU system time
11 © 2001 Hewlett-Packard Company
H4262S B.02
Activities that Utilize the CPU
• Process management
• File system I/O
• Memory management activities
• System calls
• Applications (for example, CAD-CAM and database
processes)
• Batch jobs
12 © 2001 Hewlett-Packard Company
H4262S B.02
glance — CPU Report
B3692A GlancePlus B.10.12 05:00:42 e2403roc 9000/856 Current Avg High--------------------------------------------------------------------------------CPU Util S SU U | 25% 20% 47%Disk Util F FV | 12% 6% 23%Mem Util S SU UB B | 85% 83% 85%Swap Util U UR R | 18% 18% 18%-------------------------------------------------------------------------------- CPU REPORT Users= 4State Current Average High Time Cum Time--------------------------------------------------------------------------------User 18.9 6.0 32.3 0.96 3.61Nice 0.0 2.4 5.7 0.00 1.47Negative Nice 0.4 0.8 16.2 0.02 0.51RealTime 0.4 0.4 0.7 0.02 0.22System 3.3 7.0 16.2 0.17 4.21Interrupt 1.8 1.7 2.7 0.09 1.02ContextSwitch 0.6 0.7 1.4 0.03 0.40Traps 0.0 0.0 0.0 0.00 0.00Vfaults 0.0 0.7 3.6 0.00 0.45Idle 74.6 80.2 91.2 3.79 48.18Load Average 0.1 0.4 0.8
Top CPU user: PID 2097, dthelpview 19.5% cpu util
13 © 2001 Hewlett-Packard Company
H4262S B.02
glance — CPU by Processor
B3692A GlancePlus B.10.12 05:13:18 e2403roc 9000/856 Current Avg High--------------------------------------------------------------------------------CPU Util S SU U | 25% 20% 47%Disk Util F FV | 12% 6% 23%Mem Util S SU UB B | 85% 83% 85%Swap Util U UR R | 18% 18% 18%-------------------------------------------------------------------------------- CPU BY PROCESSOR Users= 4CPU Util LoadAvg(1/5/15 min) CSwitch Last Pid-------------------------------------------------------------------------------- 0 25.4 0.6/ 0.4/ 0.3 72187 1061
Page 1 of 2
14 © 2001 Hewlett-Packard Company
H4262S B.02
glance — Individual Process
B3692A GlancePlus B.10.12 15:17:52 e2403roc 9000/856 Current Avg High--------------------------------------------------------------------------------CPU Util S SN NU | 22% 29% 51%Disk Util F | 1% 7% 13%Mem Util S SU UB B | 91% 91% 91%Swap Util U UR R | 25% 24% 35%--------------------------------------------------------------------------------Resource Usage for PID: 16013, netscape PPID: 12988 euid: 520 User:sohrab--------------------------------------------------------------------------------CPU Usage (sec) : 3.38 Log Reads : 166 Rem Log Rds/Wts: 0/ 0User/Nice/RT CPU: 2.43 Log Writes: 75 Rem Phy Rds/Wts: 0/ 0System CPU : 0.73 Phy Reads : 4Interrupt CPU : 0.14 Phy Writes: 61 Total RSS/VSS : 22.4mb/ 28.3mbCont Switch CPU : 0.08 FS Reads : 4 Traps / Vfaults: 414/ 8Scheduler : HPUX FS Writes : 29 Faults Mem/Disk: 0/ 0Priority : 154 VM Reads : 0 Deactivations : 0Nice Value : 24 VM Writes : 0 Forks & Vforks : 0Dispatches : 1307 Sys Reads : 0 Signals Recd : 339Forced CSwitch : 460 Sys Writes: 32 Mesg Sent/Recd : 775/ 1358VoluntaryCSwitch: 814 Raw Reads : 0 Other Log Rd/Wt: 3924/ 957Running CPU : 0 Raw Writes: 0 Other Phy Rd/Wt: 0/ 0CPU Switches : 0 Bytes Xfer: 410kb Proc Start TimeWait Reason : SLEEP Fri Feb 6 15:14:45 1998
15 © 2001 Hewlett-Packard Company
H4262S B.02
glance — Global System CallsB3692A GlancePlus B.10.12 05:17:52 e2403roc 9000/856 Current Avg High--------------------------------------------------------------------------------CPU Util S SU U | 25% 20% 47%Disk Util F FV | 12% 6% 23%Mem Util S SU UB B | 85% 83% 85%Swap Util U UR R | 18% 18% 18%-------------------------------------------------------------------------------- GLOBAL SYSTEM CALLS Users= 4System Call Name ID Count Rate CPU Time Cum Ct CumRate Cum CPU--------------------------------------------------------------------------------syscall-0 0 16 3.1 0.05921 663 7.6 2.19037fork 2 0 0.0 0.00000 12 0.1 0.01398read 3 105 20.5 0.00210 4110 47.2 0.07625write 4 47 9.2 0.00208 1968 22.6 0.13624open 5 16 3.1 0.00143 347 3.9 0.03146close 6 16 3.1 0.00040 381 4.3 0.00848wait 7 1 0.1 0.00011 3 0.0 0.00031time 13 46 9.0 0.00023 914 10.5 0.00446chmod 15 0 0.0 0.00000 1 0.0 0.00009ioctl 54 503 57.8 0.00900 51644 165.1 0.79813poll 269 277 48.5 0.00983 52440 138.0 1.83466
Cumulative Interval: 87 secs Page 1 of 7
16 © 2001 Hewlett-Packard Company
H4262S B.02
glance — System Calls by Process
B3692A GlancePlus B.10.12 05:39:20 e2403roc 9000/856 Current Avg High--------------------------------------------------------------------------------CPU Util S SN NU | 22% 29% 51%Disk Util F | 1% 7% 13%Mem Util S SU UB B | 91% 91% 91%Swap Util U UR R | 25% 24% 35%--------------------------------------------------------------------------------System Calls for PID: 1822, netscape PPID: 1775 euid: 503 User:roc Elapsed ElapsedSystem Call Name ID Count Rate Time Cum Ct CumRate CumTime--------------------------------------------------------------------------------read 3 477 93.5 0.16884 742 49.1 0.24275write 4 219 42.9 0.02831 352 23.3 0.06787open 5 63 12.3 0.01396 99 6.5 0.02491close 6 9 1.7 0.00046 20 1.3 0.00104time 13 34 6.6 0.00031 89 5.8 0.00083brk 17 27 5.2 0.00171 45 2.9 0.00264lseek 19 69 13.5 0.00150 135 8.9 0.00304stat 38 4 0.7 0.00131 13 0.8 0.00415ioctl 54 636 124.7 0.01463 1167 77.2 0.02813utssys 57 0 0.0 0.00000 3 0.1 0.00013
Cumulative Interval: 15 secs Page 1 of 3
17 © 2001 Hewlett-Packard Company
H4262S B.02
timex Command
$ timex prime_med
real 25.65user 20.71sys 3.43
18 © 2001 Hewlett-Packard Company
H4262S B.02
Tuning a CPU-Bound System — Hardware Solutions
• Upgrade to a faster processor
• Upgrade the system with a larger data/instruction cache
• Add a processor to a multiprocessor system
• Spread applications to multiple systems
19 © 2001 Hewlett-Packard Company
H4262S B.02
Tuning a CPU-Bound System — Software Solutions
• Nice less important processes
• Anti-nice important processes
• Consider using rtprio or rtsched on important
processes
• Run batch jobs during non-peak hours
• Consider using PRM or WLM
• Consider using the processor affinity call mpctl()
• Optimize/recompile application
20 © 2001 Hewlett-Packard Company
H4262S B.02
CPU
TLB Cache Coprocessor
CPU
TLB Cache Coprocessor
System Bus
Memory
Process
mpctl (proc2)
Processor 1 Processor 2
Is each processor pulling its weight?
The sar -uqM command string can help you monitor the CPUloading on the individual processors in a MP system.
CPU Utilization and MP Systems
21 © 2001 Hewlett-Packard Company
H4262S B.02
Processor Affinity
CPU
TLB Cache Coprocessor
CPU
TLB Cache Coprocessor
System Bus
Memory
Process
mpctl (proc2)
Processor 1 Processor 2
The mpctl() system call assigns the calling process to a specific processor.