210 likes | 366 Views
CPU Management. Version B.02 H4262S Module 5 Slides. Processor Module. CPU. TLB. Cache. Coprocessor. System Bus. Symmetric Multiprocessing. CPU. CPU. TLB. Cache. TLB. Cache. Coprocessor. Coprocessor. System Bus. CPU Processor. Special Function Unit Registers. Shadow
E N D
CPU Management Version B.02 H4262S Module 5 Slides
Processor Module CPU TLB Cache Coprocessor System Bus
Symmetric Multiprocessing CPU CPU TLB Cache TLB Cache Coprocessor Coprocessor System Bus
CPU Processor Special Function Unit Registers Shadow Registers General Registers Control Registers Space Registers CPU Process Status Word Coprocessor Registers Instruction Address Queues TLB Cache Coprocessor
CPU Cache Memory CPU Instruction to Execute xxxx xxxx Process Text TLB Cache Coprocessor System Bus
VA\PA TLB Cache Memory Instruction Address Queues CPU Instruction to Execute 0 . . . 4GB xxxx xxxx VA | PA Process Text TLB Cache Coprocessor System Bus
TLB, Cache, and Memory Cache Hit Miss X X Memory Hit Hit Hit Miss Consequence 1 CPU cycle fetch Data/instruction memory fetch PDIR memory fetch Page fault TLB Hit Hit Miss Miss X = Don’t Care
HP-UX 11.00 — Performance Optimized Page Sizes (POPS) VA PA 0 8192 65536 128000 256000 512000 Filesystem 0 8192 4096 65536 8192 128000 12288 256000 16384 512000 HP-UX 10.x Fixed Page Size – 4 KB VA 0 4096 8192 12288 16384 TLB (on CPU) File Memory VA PA 0 8192 512000 HP-UX 11.00 Variable Page Size Range: 4 KB – 64 MB 0 8192 16384 512000 Filesystem VA 0 16384 File TLB (on CPU) Memory
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)
CPU — Metrics to Monitor per Process • Process priority • Process nice value • Amount of CPU user time • Amount of CPU system time
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
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= 4 State Current Average High Time Cum Time -------------------------------------------------------------------------------- User 18.9 6.0 32.3 0.96 3.61 Nice 0.0 2.4 5.7 0.00 1.47 Negative Nice 0.4 0.8 16.2 0.02 0.51 RealTime 0.4 0.4 0.7 0.02 0.22 System 3.3 7.0 16.2 0.17 4.21 Interrupt 1.8 1.7 2.7 0.09 1.02 ContextSwitch 0.6 0.7 1.4 0.03 0.40 Traps 0.0 0.0 0.0 0.00 0.00 Vfaults 0.0 0.7 3.6 0.00 0.45 Idle 74.6 80.2 91.2 3.79 48.18 Load Average 0.1 0.4 0.8 Top CPU user: PID 2097, dthelpview 19.5% cpu util
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= 4 CPU Util LoadAvg(1/5/15 min) CSwitch Last Pid -------------------------------------------------------------------------------- 0 25.4 0.6/ 0.4/ 0.3 72187 1061 Page 1 of 2
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/ 0 User/Nice/RT CPU: 2.43 Log Writes: 75 Rem Phy Rds/Wts: 0/ 0 System CPU : 0.73 Phy Reads : 4 Interrupt CPU : 0.14 Phy Writes: 61 Total RSS/VSS : 22.4mb/ 28.3mb Cont Switch CPU : 0.08 FS Reads : 4 Traps / Vfaults: 414/ 8 Scheduler : HPUX FS Writes : 29 Faults Mem/Disk: 0/ 0 Priority : 154 VM Reads : 0 Deactivations : 0 Nice Value : 24 VM Writes : 0 Forks & Vforks : 0 Dispatches : 1307 Sys Reads : 0 Signals Recd : 339 Forced CSwitch : 460 Sys Writes: 32 Mesg Sent/Recd : 775/ 1358 VoluntaryCSwitch: 814 Raw Reads : 0 Other Log Rd/Wt: 3924/ 957 Running CPU : 0 Raw Writes: 0 Other Phy Rd/Wt: 0/ 0 CPU Switches : 0 Bytes Xfer: 410kb Proc Start Time Wait Reason : SLEEP Fri Feb 6 15:14:45 1998
glance — Global System Calls B3692A 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= 4 System Call Name ID Count Rate CPU Time Cum Ct CumRate Cum CPU -------------------------------------------------------------------------------- syscall-0 0 16 3.1 0.05921 663 7.6 2.19037 fork 2 0 0.0 0.00000 12 0.1 0.01398 read 3 105 20.5 0.00210 4110 47.2 0.07625 write 4 47 9.2 0.00208 1968 22.6 0.13624 open 5 16 3.1 0.00143 347 3.9 0.03146 close 6 16 3.1 0.00040 381 4.3 0.00848 wait 7 1 0.1 0.00011 3 0.0 0.00031 time 13 46 9.0 0.00023 914 10.5 0.00446 chmod 15 0 0.0 0.00000 1 0.0 0.00009 ioctl 54 503 57.8 0.00900 51644 165.1 0.79813 poll 269 277 48.5 0.00983 52440 138.0 1.83466 Cumulative Interval: 87 secs Page 1 of 7
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 Elapsed System Call Name ID Count Rate Time Cum Ct CumRate CumTime -------------------------------------------------------------------------------- read 3 477 93.5 0.16884 742 49.1 0.24275 write 4 219 42.9 0.02831 352 23.3 0.06787 open 5 63 12.3 0.01396 99 6.5 0.02491 close 6 9 1.7 0.00046 20 1.3 0.00104 time 13 34 6.6 0.00031 89 5.8 0.00083 brk 17 27 5.2 0.00171 45 2.9 0.00264 lseek 19 69 13.5 0.00150 135 8.9 0.00304 stat 38 4 0.7 0.00131 13 0.8 0.00415 ioctl 54 636 124.7 0.01463 1167 77.2 0.02813 utssys 57 0 0.0 0.00000 3 0.1 0.00013 Cumulative Interval: 15 secs Page 1 of 3
timex Command $ timex prime_med real 25.65 user 20.71 sys 3.43
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
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
CPU Utilization and MP Systems Processor 1 Processor 2 Memory CPU CPU Process mpctl (proc2) Coprocessor Coprocessor TLB Cache TLB Cache System Bus Is each processor pulling its weight? The sar -uqM command string can help you monitor the CPU loading on the individual processors in a MP system.
Processor Affinity Processor 1 Processor 2 Memory CPU CPU Process mpctl (proc2) Coprocessor Coprocessor TLB Cache TLB Cache System Bus The mpctl() system call assigns the calling process to a specific processor.