process resource manager 2002. 10. 17 강사 : 이 동 주 과장 hpcs / mc
Post on 18-Jan-2016
216 Views
Preview:
TRANSCRIPT
Process Resource Manager
2002. 10. 17강사 : 이 동 주 과장
HPCS / MC
Agenda
• Process Resource Manager • Resource Managed• 4 Resource Managers • Why use PRM • PRM — Application Groups • The “Carousel” Paradigm • Two types of PRM Group• What are Shares• How PRM manages Resources• Configuring PRM – quick start • PRM configuration file• What Is HP-UX Workload Manager• PRM DEMO, Q&A
The HP Process Resource Manager
• Resource management tool
• control the amount of resources that applications
or users consume
• enforce a maximum cap of cpu and memory resource
Process Resource Manageris an optional HP-UX performance management product.
The HP Process Resource Manager
Resource usage doesn’t have to be a “horse race” !PRM allows the system administrator to group processes and specify the level of importance (and resource allocation limits) of each group.
And They’re off !Group 1
Group 1
Other
Resources Managed
Memory
Disk I/O
CPU
Memory paging
Process/Thread scheduler
Disk read/writerequests
4 Resource Managers
• CPU – ensures that each PRM group is grantd at least it entilement, but (optionally) no more than it’s capped amount of CPU
• MEMORY - ensures that each PRM group is grantd at least it entilement, but (optionally) no more than it’s capped amount of MEMORY
• DISK - ensures that each PRM group is grantd at least it entilement, of disk bandwidth
• APPL - ensures that specified applications and their child processes run in the appropriate PRM groups
Why use PRM
• improve the response time for critical users and applications
• set and manage user expectations for performance
• allocate shared servers based on budgeting
• ensure that an application package in a MC/SG cluster has sufficient resources on an active standby system in the event of failover
• ensure that critical users or applications have sufficient CPU, memory and disk bandwidth resources
• restrict the CPU, memory and disk bandwidth resources available to relatively low-priority users and application during times of heavy demand
• monitor resource consumption by users or applications
Resource Allocations without PRM
Resource allocated evenly between all the processes on the system
Resource Allocations with PRM
Resource usage balanced between users
Resource Allocations with PRM
GroupC takes priority over GroupA and GroupB
PRM — Application Groups
• All PRM actions are based on processes belonging to an application group.
• Processes are initially assigned to the PRM group of the user that invoked them.
• A process may be moved to another group by the “Application Manager” if it matches the application definition criteria (executable name, executable pathname).
The “Carousel” Paradigm
PRM groups are represented by different color horses on a resource carousel.The numberof horses of each color dependson that groups entitlement.
The kernel references thecarousel when makingscheduling decisions.
Two types of PRM Groups
• FSS PRM Group – resources allocated to them using the shares model
• PSET PRM Group – the CPU entitlement is specified by assigning them a subset of the system’s processors
What are Shares
• Minimum amounts of a resources assigned to each PRM group
• A share is a guaranteed minimum when the system is at peak load
How PRM manages CPU
• Group1 has 33 CPU shares, and Group2 has 66 CPU shares
How PRM manages real memory
Two memory managers• prm0d – default on HP-UX version prior to 11i• Prm2d – default as of HP-UX 11i
Exception of memory control• Interactive shells• Login shells• PRM commands• Applications listed in /opt/prm/exempt• Processes with locked memory• The kernel• Processes in the PRM_SYS group (PRMID 0)
Shares and Cap• Share is a lower bound, Cap is a upper bound(optional)
How PRM manages real memory
Isolating a group’s memory resources• Can be useful for applications that need dedicated memory
resources
How PRM manages disk bandwidth
• Disk must be under the control of LVM• Works only when there is contention for disk bandwidth• Works only for actual I/O to the disk(no buffer cache I/O)• Cannot allocate disk bandwidth shares for PSET PRM groups
How PRM manages Applications
• By the user• By at• By cron• Upon login• By prmrun• By prmmove• By another process
PRM’s group assignments at process start-up
Configuring PRM – quick start
• Determine configuration model• Create configuration file use prmloadconf command to create /etc/prmconf file• Customize the configuration file• Check the syntax
prmconfig –s [-f configfile]• Load the configuration
prmconfig –i [-f configfile] or prmconfig –k [-f configfile]
• Enable PRMprmconfig -e
• Confirm that process are running in the PRM groupsps -efP
PRM configuration file
• Default configuration file - /etc/prmconfalternate configuration file - /opt/prm/conf directory
• Five record types - Group/CPU
- Memory- Disk bandwidth- Application- User
Group/CPU record syntax
GROUP:{ PRMID | HIER | PSET }:SHARES::[CPUS]:[CPU_LIST]
Memory record syntax
#!PRM_MEM:{PRMID|GROUP}:SHARES:[CAP]:[SUPRESS]::[[IMPORT]:[EXPORT]:[LOCKABLE]]
Disk record syntax
VOLUME:{ PRMID | GROUP }:SHARES::
# PRM disk records
/dev/vg01/lvol1:1:15::/dev/vg01/lvol1:2:30::/dev/vg01/lvol1:3:40::/dev/vg01/lvol1:4:80::/dev/vg02/lvol2:1:15::/dev/vg02/lvol2:2:30::/dev/vg02/lvol2:3:40::/dev/vg02/lvol2:4:80::
Application record syntax
APPLICATION::::GROUP[,ALT_NAME[,…,ALT_NAME]]
# PRM application records
/usr/bin/database::::business_apps,db_inventory,db_payroll
/usr/bin/database::::order_process,db_orders,order_report*
/usr/bin/mail::::mailserver
User record syntax
USER::::INITIALGROUP[,ALTERNATEGROUP[, …]]
# PRM user records
sysadm::::OTHERSengineer1::::development,OTHERSuser1::::OTHERSuser2::::sales+marketing::::mktg
Resource Monitoring
• PRM monitor (prmmonitor command)shows percentage of CPU, memory and disk bandwidthallocated to and used by PRM groups
• prmanalyze analyzes accounting files• Perfview analyzer• GlancePlus• acctcom• PRM memory message logging
prmconfig –L MEM
Viewing CPU Allocations with gpm
CPU Allocationwith PRM Disabled
CPU Allocationwith PRM Enabled
PRM — Commands
•xprm•prmanalyze•prmavail•prmconfig•prmlist•prmloadconf•prmmonitor•prmmove•prmrecover•prmrun
Starting the Process Resource Manager
Create your prmconf file
As root enter # prmconfig -ekMonitor your systembehavior using prmmonitorand glance/gpm (if available)
# PRM Group/CPU records PRM_SYS:0:20:: ORACLE1:1:50:: ORACLE2:2:20:: OTHERS:3:10:: # Application records /ora1/bin/oracle::::ORACLE1,ora*oracle1 /ora2/bin/oracle::::ORACLE2,ora*oracle2
Setting Up PRM Groups
...
OTHERS:1:20::ORACLE1:2:60::ORACLE2:3:20::...
/etc/prmconf
xprm GUI Interface
Setting Up PRM Applications
...
# Application records#/ora1/bin/oracle::::ORACLE1,ora*oracle1/ora2/bin/oracle::::ORACLE2,ora*oracle2...
/etc/prmconf
xprm GUI Interface
Identifying Processes to Manage
oracle 4129 1 0 04:19:19 ? 0:00 ora_pmon_oracle1 oracle 4131 1 0 04:19:19 ? 0:00 ora_dbw0_oracle1 oracle 4138 1 0 04:19:20 ? 0:00 ora_lgwr_oracle1 oracle 4140 1 0 04:19:20 ? 0:01 ora_ckpt_oracle1 oracle 4142 1 0 04:19:20 ? 0:00 ora_smon_oracle1 oracle 4144 1 0 04:19:20 ? 0:00 ora_reco_oracle1
oracle 4047 1 0 04:17:34 ? 0:00 ora_pmon_oracle2 oracle 4049 1 0 04:17:34 ? 0:00 ora_dbw0_oracle2 oracle 4056 1 0 04:17:34 ? 0:00 ora_lgwr_oracle2 oracle 4058 1 0 04:17:34 ? 0:01 ora_ckpt_oracle2 oracle 4060 1 0 04:17:35 ? 0:00 ora_smon_oracle2 oracle 4062 1 0 04:17:35 ? 0:00 ora_reco_oracle2
user4 6247 6244 0 04:41:52 ? 0:00 oracleoracle1 user2 6158 6155 0 04:38:16 ? 0:00 oracleoracle2 user3 6260 6257 0 04:42:44 ? 0:00 oracleoracle2 user1 6279 6276 0 04:43:25 ? 0:00 oracleoracle1
oracle 4078 1 0 04:41:52 ? 0:00 tnslsnr LISTENER_oracle1 oracle 4159 1 0 04:38:16 ? 0:00 tnslsnr LISTENER_oracle2
Moving Processes to Different PRM Groups
# ps -efPUID PRMID PID PPID C STIME TTY TIME COMMANDoracle OTHERS 4078 1 0 04:41:52 ? 0:00 tnslsnr LISTENER_oracle1oracle OTHERS 4159 1 0 04:38:16 ? 0:00 tnslsnr LISTENER_oracle2
# prmmove ORACLE1 -p 4078
# prmmove ORACLE2 -p 4159
# ps -efPUID PRMID PID PPID C STIME TTY TIME COMMANDoracle ORACLE1 4078 1 0 04:41:52 ? 0:00 tnslsnr LISTENER_oracle1oracle ORACLE2 4159 1 0 04:38:16 ? 0:00 tnslsnr LISTENER_oracle2
What Is HP-UX Workload Manager?
• System management: availability of the system.– Is good system availability enough?
• Workload management: availability of applications at a specified level of performance.
– IT service management– service-level agreements– service-level objectives
What WLM Does
• Extends the ability of PRM– CAUTION: WLM controls PRM to deliver the required service levels. Do not modify PRM
directly on a system that uses WLM!• Defines workload groups
– Users and Applications are registered as with PRM• Defines Service Level Objectives (SLOs)
– Entitlement based vs Goal based SLOs• Collects data on system operation
– Metrics are defined in SLO• Redistributes resources
How Workload EntitlementsAre Determined• CPU
- Initial controller requests are between min and max CPU
- Subsequent dynamic controller requests are based on performance needs measured against actual metrics.
- Data collection interface is required for goal based SLOs
• Real memory is set in configuration file. Not dynamic.– Not recommended for groups with goal based SLOs
• Disk bandwidth is set in the configuration file. Not dynamic.– Needs LVM. Not possible on discs with swap partitions.
How WLM Works
wlmd1. Sets initial PRM resource entitlements2. Accepts metric data from data collectors3. Compares metric data to user-specified goals for each SLO4. Sets new entitlement requests for each SLO so that
performance is closer to goal5. Arbitrates between SLO entitlement requests when
resources are insufficient to satisfy all6. Implements new CPU entitlements7. Repeats 2 through 6
WLM daemon (wlmd)
Controller
Controller
Controller
Arbiter
Datacollector 1
Datacollector 2
Datacollector 3
PRM control
App1
App2
App3
WLMconfiguration
file
SLOsdefined
here
WLMEMS monitor
EMSSLOstatsEMS
monitor
WLM Components
Migrating from PRM to WLM
• The wlmprmconf utility– Takes a valid PRM configuration file and translates it
to the equivalent WLM configuration.– Warning PRM warnings become WLM errors!– “distribute_excess” may be required to remove CPU
cap.
• The resulting text file can be edited to:– add SLO goals– change priorities– add time-based conditions and exceptions– modify WLM tuning parameters
Supplying Data to WLM
• Data-centric approach– ARM-instrumented applications– Glance Plus resources– source code modification
• Transport-centric approach– command line– shell script– perl programs– stdout– WLM API
WLM Data Collectors
• Data collectors report workload performance to WLM– Directly using the WLM API– Indirectly using wlmrcvdc and a “rendezvous point”
• The source of performance information depends on the application.– Application Response Measurement (ARM) library.– Monitor Processes
• Use C or Perl to utilize the WLM APIs directly.• Use Shell scripts to send data via the wlmsend
command.• Reported metrics are compared to goals.
Monitoring wlmd
• Turn on WLM Logging
• wlmd –a configfile –l slo,metric– Provides logging of SLO compliance and all all metric
values– Logfile is /var/opt/wlm/wlmdstats
WLM EMS Monitor
– WLM has an EMS monitor to track performance.– EMS monitor available for WLM System– EMS monitors available for each SLO– This data is available to standard EMS clients
including SAM and IT/O.
PRM DEMO, Q&A
top related