Solaris Resource Manager



Similar documents
Sun Management Center Change Manager Release Notes

Solaris 10 Documentation README

SunFDDI 6.0 on the Sun Enterprise Server

Sun StorEdge A5000 Installation Guide

Optimizing Solaris Resources Through Load Balancing

N1 Grid Service Provisioning System 5.0 User s Guide for the Linux Plug-In

Upgrading the Solaris PC NetLink Software

Sun Enterprise Optional Power Sequencer Installation Guide

Service Level Definitions and Interactions

Sun Cluster 2.2 7/00 Data Services Update: Apache Web Server

Sun StorEdge RAID Manager Release Notes

Scrubbing Disks Using the Solaris Operating Environment Format Program

Sun Management Center 3.5 Update 1b Release Notes

Rapid Recovery Techniques: Auditing Custom Software Configuration

Exploring the iplanet Directory Server NIS Extensions

Comparing JavaServer Pages Technology and Microsoft Active Server Pages

Solaris Bandwidth Manager

Sun Ray, Smart Cards, and Citrix

Distributed Application Management using Jini Connection Technology

Managing NFS Workloads

Sun StorEdge T3 Dual Storage Array - Part 1

Data Center Design Philosophy

JumpStart : NIS and sysidcfg

Sun StorEdge N8400 Filer Release Notes

Sun Enterprise 420R Server Product Notes

Service Level Agreement in the Data Center

Java Dynamic Management Architecture for Intelligent Networks

Sun StorEdge network FC switch-8 and switch-16 Release Notes

Disaster Recovery Requirements Analysis

Sun Management Center 3.6 Version 5 Add-On Software Release Notes

Sun StorEdge Availability Suite Software Point-in-Time Copy Software Maximizing Backup Performance

Reducing the Backup Window With Sun StorEdge Instant Image Software

LAN-Free Backups Using the Sun StorEdge Instant Image 3.0 Software

Solaris 9 9/05 Installation Roadmap

Java Technologies for Interactive Television

Developing a Security Policy

Power Savings in the UltraSPARC T1 Processor

Sun TM SNMP Management Agent Release Notes, Version 1.6

Sun Grid Engine Release Notes

Sun Ultra 80 SCSI Cable Installation Guide

Sun Ultra TM. 5 and Ultra 10 Product Notes. Sun Microsystems, Inc. 901 San Antonio Road Palo Alto, CA U.S.A.

HelloWorld SOAP Sample:

Sun Cobalt Control Station. Using the LCD Console

Important Note on New Product Names

Rapid Recovery Techniques: Exploring the Solaris Software Registry

Sharing NFS and Remote File Systems via Solaris PC NetLink Software

Sun StorEdge Enterprise Backup Software 7.2

Sun Fire 6800/4810/4800/3800 Systems Software Release Notes

Sun Management Center 3.6 Version 4 Add-On Software Release Notes

Service Level Management in the Data Center

Sun SNMP Management Agent Release Notes, Version 1.5.5

Sun Fire 6800/4810/4800/ 3800 Systems Product Notes

A Strategy for Managing Performance

Sun Fire V20z Server Release Notes

Sun Management Center 3.0 Platform Update 4 Release Notes for Sun Fire 15K/12K Systems

Consolidation in the Data Center

The Solaris Fingerprint Database - A Security Tool for Solaris Operating Environment Files

The UltraSPARC T1 Processor - High Bandwidth For Throughput Computing

Sun StorEdge Network FC Switch-8 and Switch-16 Release Notes

N1 Grid Engine 6 Release Notes

Operations Management Capabilities Model

Platform Notes: The SunHSI/P Device Driver

Sun Fire B10n Content Load Balancing Blade Product Notes

Sun Fire 15K/12K Dynamic Reconfiguration Installation Guide and Release Notes

Sun Microsystems, Inc Garcia Avenue Mountain View, CA FAX

Java Management Extensions SNMP Manager API

Security and the Sun Java System Web Server

Using Linux mdadm Multipathing with Sun StorEdge Systems

Automating Centralized File Integrity Checks in the Solaris 10 Operating System

Sun StorEdge Instant Image 3.0 and Oracle8i Database Best Practices

SCSI Sense Key Error Guide

Sun Blade 100 CD-ROM or DVD-ROM and Hard Disk Drive Installation Guide

Sun StorEdge FC-100 Long Wave Gigabit Interface Converter Guide

Sun Fire Midframe Server Best Practices for Administration

N1 Grid Engine 6 Installation Guide

RAID Controller PCI Card for the Sun Fire V60x and V65x Servers Release Notes

SunPCi Supporting Highly Available PC Applications with Solaris

Sun StorEdge RAID Manager 6.22 User s Guide

Trust Modeling for Security Architecture Development

Sun Ray Connector for Windows OS, Version 2.1 Release Notes

Sun Fire 6800/4810/4800/3800 Systems Firmware Release Notes

Sun StorEdge T3 Dual Storage Array - Part 3 Basic Management. By Mark Garner - Enterprise Engineering Sun BluePrints OnLine - April 2001

Sun SM Remote Services Net Connect Solaris TM 9 4/04

Sun Remote System Control (RSC) Installation Guide

Solaris Patch Management: Recommended Strategies

Netra Data Plane Software Suite 2.0 Update 2 Release Notes

Sun Blade 150 CD-ROM, DVD-ROM, and Hard Drive Installation Guide

Start Here. Installation and Documentation Reference. Sun StorEdgeTM 6120 Array

Java Card Platform Security

Solaris 9 Installation Roadmap

Sun StorEdge SAN Foundation Release Notes

Conference Calling Using SunForum 3

Brocade SilkWorm 4100 FC Switch Release Notes

Sun's Auto-ID Architecture

Sun Fire V480 Server Product Notes

Sun 450 MHz UltraSPARC -II Module Upgrade

Veritas Storage Foundation 5.0 Software for SPARC

Sun N1 Service Provisioning System User s Guide for Linux Plug-In 2.0

Sun GlassFish Mobility Platform 1.1 Deployment Guide

Sun StorEdge Enterprise Backup Software 7.1

Transcription:

Solaris Resource Manager By Richard McDougall - Enterprise Engineering Sun BluePrints OnLine - April 1999 http://www.sun.com/blueprints Sun Microsystems, Inc. 901 San Antonio Road Palo Alto, CA 94303 USA 650 960-1300 fax 650 969-9131 Part No.: 806-3839-10 Revision 01, April 1999

Copyright 1999 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California 94303 U.S.A. All rights reserved. This product or document is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation. No part of this product or document may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any. Third-party software, including font technology, is copyrighted and licensed from Sun suppliers. Parts of the product may be derived from Berkeley BSD systems, licensed from the University of California. UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd. Sun, Sun Microsystems, the Sun logo, The Network Is The Computer, Sun BluePrints, Solaris Resource Manager and Solaris are trademarks, registered trademarks, or service marks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc. The OPEN LOOK and Sun Graphical User Interface was developed by Sun Microsystems, Inc. for its users and licensees. Sun acknowledges the pioneering efforts of Xerox in researching and developing the concept of visual or graphical user interfaces for the computer industry. Sun holds a non-exclusive license from Xerox to the Xerox Graphical User Interface, which license also covers Sun s licensees who implement OPEN LOOK GUIs and otherwise comply with Sun s written license agreements. RESTRICTED RIGHTS: Use, duplication, or disclosure by the U.S. Government is subject to restrictions of FAR 52.227-14(g)(2)(6/87) and FAR 52.227-19(6/87), or DFAR 252.227-7015(b)(6/95) and DFAR 227.7202-3(a). DOCUMENTATION IS PROVIDED AS IS AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. Copyright 1999 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, Californie 94303 Etats-Unis. Tous droits réservés. Ce produit ou document est protégé par un copyright et distribué avec des licences qui en restreignent l utilisation, la copie, la distribution, et la décompilation. Aucune partie de ce produit ou document ne peut être reproduite sous aucune forme, par quelque moyen que ce soit, sans l autorisation préalable et écrite de Sun et de ses bailleurs de licence, s il y en a. Le logiciel détenu par des tiers, et qui comprend la technologie relative aux polices de caractères, est protégé par un copyright et licencié par des fournisseurs de Sun. Des parties de ce produit pourront être dérivées des systèmes Berkeley BSD licenciés par l Université de Californie. UNIX est une marque déposée aux Etats-Unis et dans d autres pays et licenciée exclusivement par X/Open Company, Ltd. Sun, Sun Microsystems, le logo Sun, The Network Is The Computer, Sun BluePrints, Solaris Resource Manager, et Solaris sont des marques de fabrique ou des marques déposées, ou marques de service, de Sun Microsystems, Inc. aux Etats-Unis et dans d autres pays. Toutes les marques SPARC sont utilisées sous licence et sont des marques de fabrique ou des marques déposées de SPARC International, Inc. aux Etats-Unis et dans d autres pays. Les produits portant les marques SPARC sont basés sur une architecture développée par Sun Microsystems, Inc. L interface d utilisation graphique OPEN LOOK et Sun a été développée par Sun Microsystems, Inc. pour ses utilisateurs et licenciés. Sun reconnaît les efforts de pionniers de Xerox pour la recherche et le développement du concept des interfaces d utilisation visuelle ou graphique pour l industrie de l informatique. Sun détient une licence non exclusive de Xerox sur l interface d utilisation graphique Xerox, cette licence couvrant également les licenciés de Sun qui mettent en place l interface d utilisation graphique OPEN LOOK et qui en outre se conforment aux licences écrites de Sun. CETTE PUBLICATION EST FOURNIE "EN L ETAT" ET AUCUNE GARANTIE, EXPRESSE OU IMPLICITE, N EST ACCORDEE, Y COMPRIS DES GARANTIES CONCERNANT LA VALEUR MARCHANDE, L APTITUDE DE LA PUBLICATION A REPONDRE A UNE UTILISATION PARTICULIERE, OU LE FAIT QU ELLE NE SOIT PAS CONTREFAISANTE DE PRODUIT DE TIERS. CE DENI DE GARANTIE NE S APPLIQUERAIT PAS, DANS LA MESURE OU IL SERAIT TENU JURIDIQUEMENT NUL ET NON AVENU. Please Recycle

Solaris Resource Manager In December 1998, Sun introduced the Solaris Resource Manager software, a flexible resource management package for the Solaris Operating Environment. The Solaris Resource Manager software provides the ability to allocate and control major system resources. It also implements administrative policies that govern the resources different users can access, and more specifically, the level of consumption of those resources that each user is permitted. The Solaris Resource Manager software should be used when more advanced resource management and control is required, over and above that which can be achieved using products such as processor sets and dynamic reconfiguration. For example, two workloads can be consolidated onto a single system using processor sets to manage the CPU resource by allocating 10 processors to workload A and 8 processors to workload B. This would provide processor limits for each workload. But resources are wasted if one of the workloads is not using all of its share of the processors because the spare CPU cannot be used by any other workload. The Solaris Resource Manager software provides the following advantages over base Solaris resource control: Better utilization of system resources Dynamic control of system resources More flexible resource allocation policies Finer-grained control over resources Decayed usage of resources Accounting data for resource usage 1

TABLE 1 shows a summary of the complete range of the Solaris Resource Manager software capabilities, and the scope of each control. TABLE 1 Solaris Resource Manager Functions Policy Control Measurement Accounting CPU Usage Per User Id yes Per User Id yes Virtual Memory per-user per-process per-user per-process per-user per-process No. of processes yes yes yes yes Max Logins yes yes yes yes Connect Time yes yes yes yes A full overview of the Solaris Resource Manager software is available by browsing the following: <A HREF= http://docs.sun.com:80/ab2/coll.409.2/ RSCMGNTADMIN/@Ab2PageView/385?DwebQuery=srm >Solaris Resource Manager Introduction</A> yes Mapping the Workload to the lnode Hierarchy The key to effective resource management using Solaris Resource Manager software is a well designed resource hierarchy. Solaris Resource Manager software uses the lnode tree to implement the resource hierarchy. Each node in the lnode tree maps to UID in the password database, which means that workloads must be mapped to align with entries in the password database. In some cases, additional users may need to be created to cater to the leaf nodes in the hierarchy. These special users will not actually run processes or jobs, but will act as an administration point for the leaf node. A Simple Flat Hierarchy A simple hierarchy would, for example, control the processing resources of two users, Chuck and Mark. Both of these users are notorious for using large amounts of CPU at different times, and hence have an impact on each other at different times of the day. To resolve this, construct a single level hierarchy and allocate equal shares of CPU to each user. 2 Solaris Resource Manager April 1999

root Chuck cpu.shares=50sh Mark cpu.shares=50sh FIGURE 1 A Simple Flat Solaris Resource Manager Hierarchy This simple hierarchy is established using the limadm command to make Chuck and Mark children of root: # limadm set sgroup=root chuck # limadm set sgroup=root mark Now that both Chuck and Mark are children of the root share group, you can allocate resource shares against them. For example, to allocate 50 percent of the resources to each, give the same number of CPU shares to each. (There is no reason you could not allocate one share to each user to achieve the same). Use the limadm command to allocate the shares: # limadm set cpu.shares=50 chuck # limadm set cpu.shares=50 mark Solaris Resource Manager 3

You can observe the changes to the lnode associated with Chuck with the liminfo command: # liminfo -c chuck Login name: chuck Uid (Real,Eff): 2001 (-,-) Sgroup (uid): root (0) Gid (Real,Eff): 200 (-,-) Shares: 50 Myshares: 1 Share: 41 % E-share: 0 % Usage: 0 Accrued usage: 0 Mem usage: 0 B Term usage: 0s Mem limit: 0 B Term accrue: 0s Proc mem limit: 0 B Term limit: 0s Mem accrue: 0 B.s Processes: 0 Current logins: 0 Process limit: 0 Last used: Tue Oct 4 15:04:20 1998 Directory: /users/chuck Name: Hungry user Shell: /bin/csh Flags: The fields in from the liminfo command are explained in the liminfo manual page. <A HREF= http://docs.sun.com:80/ab2/coll.409.2/rscmgntrefman/ @Ab2PageView/886?DwebQuery=srm ></A> A Simple Form of Batch Management You can create a simple hierarchy to control the environment in which batch jobs are run. To do this, add an extra layer in the hierarchy, to divide the computational requirements of online and batch using the limadm command: # limadm set sgroup=root online # limadm set sgroup=root batch # limadm set cpu.shares=20 online # limadm set cpu.shares=1 batch # limadm set sgroup=online chuck # limadm set sgroup=online mark 4 Solaris Resource Manager April 1999

In the example above, the limadm command was used to create a new leaf in the hierarchy for online and batch, and put Chuck and Mark into the online group. root online batch cpu.shares=1sh Chuck Mark FIGURE 2 Creating Online and Batch Shares with Solaris Resource Manager By using the described hierarchy, you can ensure that the online users get their share of the processor resource. Without any further changes, both Chuck and Mark will have access to 20 times the processing resource than does batch, because their UID s map to lnodes that are under the online lnode. You must, however, ensure that the batch processes run against the batch lnode. To do this simply start the batch jobs under the batch UID. Note that there could be situations where you want to start batch jobs as a different UNIX UID but still have their resources controlled by the batch lnode. To do this, use the srmuser command to start the batch job against the batch lnode: # srmuser batch /export/database/bin/batchjob For further information on batch management and batch management tools, refer to the Workload Managment chapter in the Resource Management BluePrint Consolidation Since the Solaris Resource Manager software is a key component of batch management, we will discuss how Solaris Resource Manager would be used to implement portions of workload consolidation. Solaris Resource Manager 5

The Solaris Resource Manager software allows systems resources to be allocated at a system-wide level, sometimes in proportion with business arrangements of machine allocation between departments. An additional layer in the Solaris Resource Manager hierarchy is used to achieve this. root Sales Database Finance Database cpu.shares=60sh cpu.shares=40sh online batch online batch cpu.shares=1sh cpu.shares=1sh Chuck Mark Jenny Les FIGURE 3 Consolidation of Two Databases with Solaris Resource Manager Managing Web Servers The Solaris Resource Manager software can be used to manage resources on web servers by controlling the amount of CPU and virtual memory. Three basic topologies are used on systems hosting web servers. Resource Managing a Consolidated Web Server A single web server can be managed by controlling the amount of resources that the entire web server can use. This would be useful in an environment where a web server is being consolidated with other workloads. This most basic form of resource management simply prevents other workloads from affecting the performance of the web server, and vice versa. 6 Solaris Resource Manager April 1999

root Sales Database cpu.shares=80sh Web Server memory=50mb online batch cpu.shares=1sh Chuck FIGURE 4 Mark Resource Managing a Consolidated Web Server In the above example, the Web server is allocated 20 shares. This means that it is guaranteed at least 20 percent of the processor resources if the database place excessive demands on the processor. In addition, if a CGI-BIN process in the web server runs out of control with a memory leak, the entire system will not runout of swap space. Only the web server will be affected. Fine Grained Resource Management of a Single Web Server There are often requirements to use resource management to control the behavior within a single web server. For example, a single web server can be shared between many users, each with their own CGI-BIN programs. An error in a CGI-BIN program could cause the entire web server to run slow, of in the case of a memory leak could even bring down the web server. To prevent this from happening, use the per-process limits. Solaris Resource Manager 7

Web Server memory=50mb process.memory=5mb Web Server, httpd limited to 5MB of virtual memory /usr/lib/httpd /cgi-bin/form.pl /cgi-bin/lookup.sh CGI-BIN perl program limited to 5MB of virtual memory. Shell program limited to 5MB of virtual memory. Total CPU limited to 20 Shares FIGURE 5 Fine Grained Resource Management of a Single Web Server Resource Management of Multiple Virtual Web Servers Single machines are often used to host multiple virtual web servers In such cases, there are multiple instances of the httpd web server. There is also greater opportunity to exploit resource control using the Solaris Resource Manager software. It is possible to run each web server as a different UNIX UID by setting a parameter in the web server configuration file. This effectively attaches each web server to a different lnode in the Solaris Resource Manager software hierarchy. 8 Solaris Resource Manager April 1999

For example, the Solaris web server has the following parameter in the configuration file, /etc/http/httpd.conf: # Server parameters server { server_root "/var/http/" server_user "webserver1" mime_file "/etc/http/mime.types" mime_default_type text/plain acl_enable "yes" acl_file "/etc/http/access.acl" acl_delegate_depth 3 cache_enable "yes" cache_small_file_cache_size 8 # megabytes cache_large_file_cache_size 256 # megabytes cache_max_file_size 1 # megabytes cache_verification_time 10 # seconds comment "Sun WebServer Default Configuration" # The following are the server wide aliases map /cgi-bin/ /var/http/cgi-bin/ cgi map /sws-icons/ /var/http/demo/sws-icons/ map /admin/ /usr/http/admin/ # To enable viewing of server stats via command line, # uncomment the following line map /sws-stats dummy stats } FIGURE 6 Solaris Web Server Parameter File By configuring each web server to run as a different UNIX UID you can set different limits on each web server. This is particularly useful for controlling and accounting for resource usage on a machine hosting many web servers. You can make use of most or all of the Solaris Resource Manager resource controls and limits as follows: Shares [cpu.shares] Mem limit [memory.limit] Proportionally allocate resources to the different web servers. Limit the amount of virtual memory that the web server can use. This will prevent any single web server from causing another one to fail. Solaris Resource Manager 9

Proc mem limit [memory.plimit] Process limit [process.limit] Limit the amount of virtual memory a single cgi-bin process can use. This will stop any cgi-bin process from bringing down its respective web server. The maximum total number of processes allowed to attach to a web server. This will effectively limit the number of concurrent cgi-bin processes. Creating a Policy on Executable Name In some cases it may be useful to construct a hierarchy that allocates resources based on the application each user is executing. Use the srmuser command and wrappers around the executables. Create a different point in the hierarchy for each application type. Then authorize users to switch lnodes as they execute each application. root Users Applications Mark Chuck /usr/bin/app1 /usr/bin/app2 cpu.shares=1sh FIGURE 7 A Hierarchy Allowing Policies by Executable Name 10 Solaris Resource Manager April 1999

The simple hierarchy in the above example is established using the limadm command and makes Chuck and Mark children of the users group, and app1 and app2 are made children of the applications group: # limadm set sgroup=root users # limadm set sgroup=users chuck # limadm set sgroup=users mark # limadm set sgroup=root apps # limadm set sgroup=apps app1 # limadm set sgroup=apps app2 Give both Chuck and Mark permission to switch lnodes on their child processes. This allows you to attach /usr/bin/app1 to the app1 lnode and /usr/bin/app2 to the app2 lnode. # limadm set flag.admin=s chuck # limadm set flag.admin=s mark Allocate shares to both applications in the desired proportions: # limadm set cpu.shares=20 app1 # limadm set cpu.shares=1 app2 Now use the srmuser command to create a simple wrapper script to set the appropriate lnodes upon execution of the applications: #!/bin/sh # # Execute /usr/bin/app1 and attach it to the app1 lnode # /usr/srm/bin/srmuser app1 /usr/bin/app1 Author s Bio: Richard McDougall Richard has over 11 years of UNIX experience including application design, kernel development and performance analysis, and specializes in operating system tools and architecture. Solaris Resource Manager 11