====== WPAR: using Worload Manager to contol ressource between WPAR ====== ===== Concept ===== On WPAR, it's possible to limit many parmeters, but it can be dangerous! The best practice is to only limit the CPU utilization. If you limit the memory on a WPAR, this WPAR can die. **Important:** Keep in mind that when you specify the minimum, soft maximum, and hard maximum percentages, the following rules apply: * The sum of minimum percentage for all running WPARs must not exceed 100. * For each WPAR, the minimum percentage must not exceed the soft maximum percentage. * For each WPAR, the soft maximum percentage must not exceed the hard maximum percentage. Parameters to change in case of CPU limitation: - shares_CPU= Specifies the number of processor shares available for the WPAR. Shares value can be from 1 to 65535. - CPU=%-%,% Specifies as the minimum CPU percentage, as the soft maximum CPU percentage and as the hard maximum CPU percentage for the WPAR. ==== Using share-based resource control ==== The share-based approach implies allocating available CPU resources to WPARs based on their importance. The total amount of processing power is conceptually divided in shares. Example: Assume there are two WPARs: WPAR A is assigned 5 shares and WPAR B is assigned 10 shares. – The total number of shares is 5+10=15. – The WPAR A percentage is 5/15=33%. – The WPAR B percentage is 10/15=66%. Therefore, WLM assigns 33% of the existing CPU resources to WPAR A, and 66% of existing CPU resources to WPAR B. A new WPAR named WPAR C is added to the system and assigned 15 shares. – The total number of shares is now 5+10+15=30. – The WPAR A new percentage is 5/30=17%. – The WPAR B new percentage is 10/30=33%. – The WPAR C new percentage is=15/30=50%. ==== Using percentage-based resource control ==== Consider using percentage-based controls in these cases: * When you want to guarantee at all times that a minimum amount of CPU resources is available for a WPAR * When you want to limit the maximum amount of CPU resources a WPAR can use - The minimum percentage value reflects the amount of CPU resource capacity allocated to a WPAR. If the WPAR uses less than this amount, depending on the WLM setup, one of the following conditions will occur: * The amount of CPU resources will be reserved for the WPAR’s exclusive usage and will not be redistributed to the global environment. * WLM will raise the priority of WPAR processes and redistribute the unused amount to the global environment. If at any time later the WPAR needs the unused resource it can reclaim it, and because it has the highest priority, it will get it. - The soft maximum percentage reflects the maximum amount of CPU resources a WPAR may ever get when contention conditions for CPU resources occur. If the system has enough CPU power and contention does not occur, then the WPAR may go over this limit. - The hard maximum percentage is the absolute amount of CPU resources that a WPAR may ever have. This limit can never be exceeded. ===== Setup Worload Manager ===== Change the settings shares_CPU and CPU (dynamic): # chwpar -R shares_CPU=100 CPU=6%-30%,45% wpar01 List the settings on the WPAR: # lswpar -R wpar01 ================================================================= wpar01 - Active Tip: We recommend that you start with the share-based approach to control the resources. In almost all cases, your requirements will be met. ================================================================= Active: yes RSet: CPU Shares: 100 CPU Limits: 6%-30%,45% ====== WPAR: preview ressources used for a WPAR ====== List WPAR ressources: [root@lpartest]/root# lswpar -R ================================================================= wpar01 - Active ================================================================= Active: yes Resource Set: CPU Shares: unlimited CPU Limits: 0%-100%,100% Memory Shares: unlimited Memory Limits: 0%-100%,100% Per-Process Virtual Memory Limit: unlimited Total Virtual Memory Limit: unlimited Total Processes: unlimited Total Threads: unlimited Total PTYs: unlimited Total Large Pages: unlimited Max Message Queue IDs: 100% Max Semaphore IDs: 100% Max Shared Memory IDs: 100% Max Pinned Memory: 100% ================================================================= wpar02 - Active ================================================================= Active: yes Resource Set: CPU Shares: unlimited CPU Limits: 0%-100%,100% Memory Shares: unlimited Memory Limits: 0%-100%,100% Per-Process Virtual Memory Limit: unlimited Total Virtual Memory Limit: unlimited Total Processes: unlimited Total Threads: unlimited Total PTYs: unlimited Total Large Pages: unlimited Max Message Queue IDs: 100% Max Semaphore IDs: 100% Max Shared Memory IDs: 100% Max Pinned Memory: 100% Worload Manager command: # wlmstat -@ CLASS CPU MEM DKIO wpar01 5.79 6.49 0.00 wpar02 0.07 1.90 0.00 wpar03 40.06 6.48 0.00 wpar04 0.06 0.55 0.00 wpar05 0.14 4.85 0.00 wpar06 16.96 9.87 0.00 wpar07 0.16 4.90 0.00 wpar08 32.94 10.98 13.61 wpar09 0.07 5.38 0.00 wpar10 0.07 0.42 0.00 TOTAL 96.32 51.82 13.61 # wlmstat -@ 2 Topas command, real time: # topas -@ then press: W Topas Monitor for host: lpartest Interval: 2 Thu Apr 28 11:53:21 2011 WPAR CPU% Mem% Blk-I/O% wpar08 45 11 0 wpar06 27 10 0 wpar01 8 7 0 wpar03 6 6 0 wpar07 5 6 0 wpar05 0 5 0 wpar09 0 5 0 wpar02 0 2 0 wpar04 0 1 0 ============================================================================== DATA TEXT PAGE PGFAULTS USER PID PPID PRI NI RES RES SPACE TIME CPU% I/O OTH COMMAND oracle 11534960 6094944 79 20 4153 22182 4153 5:12 2.0 0 1 oracle oracle 18022546 5832948 80 20 7442 22182 7442 4:38 2.0 0 2 oracle oracle 40960816 11141160 89 20 19903 22182 19903 3:07 2.0 0 2 oracle oracle 6619350 11141160 70 20 9650 22182 9650 1:50 2.0 0 2 oracle oracle 6750896 5046504 74 20 6646 22182 6646 0:40 2.0 0 0 oracle oracle 62849486 11141160 69 20 7397 22182 7397 111:36 2.0 0 1 oracle //Reference:// sg247656 Workload Partition Management in IBM AIX Version 6.1 (Redbook IBM http://www.redbooks.ibm.com/)