1. Trang chủ
  2. » Công Nghệ Thông Tin

Tài liệu Module 4: Managing Applications and Services by Using Process Control pdf

80 485 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Managing Applications and Services by Using Process Control
Trường học Microsoft Corporation
Chuyên ngành Information Technology
Thể loại thesis
Năm xuất bản 2001
Thành phố Redmond
Định dạng
Số trang 80
Dung lượng 1,47 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Contents Overview 1 Rules, Processes, and Process Groups 19 Configuring the Process Control Service 21 Demonstration: Tuning the Process Rules 24 Demonstration: Defining and Testing

Trang 1

Contents

Overview 1

Rules, Processes, and Process Groups 19

Configuring the Process Control Service 21

Demonstration: Tuning the Process

Rules 24

Demonstration: Defining and Testing a

Defining Process Execution Rules 29

Setting Process Group Execution

Managing Processes and Process Groups 55

Managing Processes by Using the

Backing Up and Restoring Process

Lab A: Managing Applications and

Services by Using Process Control 60

Review 71

Module 4: Managing Applications and Services

by Using Process Control

Trang 2

Information in this document is subject to change without notice The names of companies, products, people, characters, and/or data mentioned herein are fictitious and are in no way intended

to represent any real individual, company, product, or event, unless otherwise noted Complying with all applicable copyright laws is the responsibility of the user No part of this document may

be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Microsoft Corporation If, however, your only means of access is electronic, permission to print one copy is hereby granted

Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property

 2001 Microsoft Corporation All rights reserved

Microsoft, Active Directory, BackOffice, FrontPage, Outlook, PowerPoint, Visual Studio, Windows, Windows Media, and Windows NT are either registered trademarks or trademarks of Microsoft Corporation in the U.S.A and/or other countries

Other product and company names mentioned herein may be the trademarks of their respective owners

Program Manager: Don Thompson Product Manager: Greg Bulette Instructional Designers: April Andrien, Kelley Umphrey

Subject Matter Experts: Conrad Cahill (Entirenet), Jack Creasey Classroom Automation: Lorrin Smith-Bates

Graphic Designer: Andrea Heuston (Artitudes Layout & Design) Editing Manager: Lynette Skinner

Editor: Lori Kane Copy Editor: Gwen Bloomsburg (S&T Consulting) Production Manager: Miracle Davis

Build Manager: Julie Challenger Print Production: Lori Walker (S & T Consulting)

CD Production: Eric Wagoner Test Manager: Eric R Myers Test Lead: Robertson Lee (Volt) Creative Director: David Mahlmann Media Program Manager: Scott Daniels Media Producer: Dean Connolly Lead Production Artist: Scott Serna Localization Manager: Rick Terek Operations Coordinator: John Williams Manufacturing Support: Laura King; Kathy Hershey Lead Product Manager, Release Management: Bo Galford Lead Technology Manager: Sid Benavente

Lead Product Manager: Ken Rosen Group Manager, Courseware Infrastructure: David Bramble Group Product Manager, Content Development: Julie Truax Director, Training & Certification Courseware Development: Dean Murray General Manager: Robert Stewart

Trang 3

 Describing the process execution environment

 Describing how job objects function

 Describing Process Control concepts such as components, functionality, and user interface

 Identifying rules, processes, and process groups

 Configuring the Process Control service by using Process Control properties

 Identifying Process Alias rules, Process Execution rules, and Process Group Execution rules

 Defining and testing Process Alias rules

 Defining and testing Process Execution rules

 Setting Process Group Execution rule properties

 Managing processes and process groups

 Managing processes by using the command line

 Backing up and restoring process control information from the command line

 Identifying best practices for using Process Control

Materials and Preparation

This section provides the materials and preparation tasks that you need to teach this module

Required Materials

To teach this module, you need the following materials:

 Microsoft PowerPoint® file 2089a_04.ppt

 Module 4, “Managing Applications and Services by Using Process Control”

 The Trainer Materials compact disc for two executable files, including leakyapp.exe and cpustres.exe

Preparation Tasks

To prepare for this module, you should:

 Read all of the materials for this module

 Complete the demonstrations

 Complete the labs

Presentation:

90 Minutes

Lab:

90 Minutes

Trang 4

Module Strategy

Use the following strategy to present this module:

 Process Execution Environment This topic introduces the concepts of priority, affinity, and scheduling that will be applied when using the Process Control tool later in this module This topic covers processes, threads, fibers, base priority, dynamic priority, scheduler, and processor and thread affinity

 Job Objects This topic introduces the concept of job objects that will be applied when using the Process Control tool later in this module This is followed by a discussion of accounting information and controlling child processes within

a job object

 Process Control Concepts This topic begins by introducing the Process Control components that control and manage processes This is followed by a discussion on how Process Control depends on these components to function The section concludes with a discussion on how the Process Control user interface can

be scripted, managed with graphical tools, or controlled from the command line

 Rules, Processes, and Process Groups This topic defines rules, processes, and process groups It introduces the Process Control console tree and explains how you can use this console tree

to define, view, and manage rules, processes, and process groups

 Configuring the Process Control Service This topic describes Process Control properties, explaining scan interval and request timeout interval

 Demonstration: Tuning the Process Scan Interval

In this demonstration, the instructor modifies the process scan interval so that Process Control checks for new processes more frequently than the 60-second default interval This demonstration supports the Configuring the Process Control Service topic in this module and can be conducted simultaneously

 Rules This topic introduces three types of rules created in Process Control: Process Alias rules, Process Execution rules, and Process Group Execution rules

 Defining Process Alias Rules This topic explains the purpose of defining Process Alias rules It discusses types of names, match string, and process alias assigned on a match

 Demonstration: Defining and Testing a Process Alias Rule

In this demonstration, the instructor defines and tests a new Process Alias rule for the process called notepad.exe This demonstration supports the Defining Process Alias Rules topic in this module and can be conducted simultaneously

Trang 5

 Defining Process Execution Rules This topic explains the purpose of defining Process Execution rules It describes how to assign a process to a process group, apply affinity, apply priority, and apply memory limits

 Demonstration: Defining and Testing a Process Execution Rule to Control Memory Usage

In this demonstration, the instructor defines and tests a Process Execution rule for the process alias called Notepad Alias This demonstration supports the Defining Process Execution Rules topic in this module and can be conducted simultaneously

 Setting Process Group Execution Rule Properties This topic explains the purpose of creating Process Group Execution rules

It describes limiting process count within a single processor group, applying scheduling class, setting group memory limits, setting time limits, and configuring advanced process group controls

 Demonstration: Creating and Testing a Process Group Execution Rule to Control Memory Usage

In this demonstration, the instructor creates and tests a Process Group Execution rule for the process alias called Notepad Alias This demonstration supports the Setting Process Group Execution Rule Properties topic in this module and can be conducted simultaneously

 Demonstration: Creating and Testing a Process Group Execution Rule to Control Processor Affinity

In this demonstration, the instructor creates and tests the affinity setting of a Process Group Execution rule This demonstration supports the Setting Process Group Execution Rule Properties topic in this module

This demonstration can be completed only if a server with two or more processors is available

 Managing Processes and Process Groups There are many ways that students can use the Process Control console to manage processes and process groups This topic explains three different ways

 Managing Processes by Using the Command Line The Process Control command-line utility uses a series of switches that describe the operation to perform and supply the required data This topic covers a summary of command-line operations including where, verbs, and objects

 Backing Up and Restoring Process Control Information This topic covers the syntax used at the command prompt to back up and restore Process Control rules

 Best Practices This topic explains the recommended range of operation, maintained by Process Control, for Microsoft SQL Server™, Microsoft Internet Explorer, and Microsoft Project

Note

Trang 6

 Lab A: Managing Applications and Services by Using Process Control

In this lab, students have an opportunity to manage applications and services

by using Process Control Exercises include tuning the process scan interval, defining and testing a Process Alias rule, defining and testing a Process Execution rule to control memory usage, creating and testing a Process Group Execution rule to control memory usage, and creating and testing a Process Group Execution rule to control processor affinity

Exercise 5, “Creating and Testing a Process Group Execution Rule to Control Processor Affinity,” can be completed only if a server with two or more processors is available

Note

Trang 7

Overview

 Process Execution Environment

 Job Objects

 Process Control Concepts

 Rules, Processes, and Process Groups

 Configuring the Process Control Service

 Rules

 Defining Process Alias Rules

Process Control is a tool included with Microsoft® Windows® 2000 Datacenter Server that helps you organize, control, and manage the processes on your

system and the resources they use

After completing this module, you will be able to manage applications and services by using Process Control, including:

 Describing the process execution environment

 Describing how job objects function

 Describing Process Control concepts such as components, functionality, and user interface

 Identifying rules, processes, and process groups

 Configuring the Process Control service by using Process Control properties

 Identifying Process Alias rules, Process Execution rules, and Process Group Execution rules

 Defining and testing Process Alias rules

 Defining and testing Process Execution rules

 Setting Process Group Execution rule properties

 Managing processes and process groups

 Managing processes by using the command line

 Backing up and restoring process control information from the command line

 Identifying best practices for using Process Control

Process Control is a tool

included with Windows 2000

Datacenter Server that

helps you organize, control,

and manage the processes

on your system and the

resources they use

Explain the purpose of the

module

Describe the list of learning

objectives

Trang 8

Overview (continued)

 Defining Process Execution Rules

 Setting Process Group Execution Rule Properties

 Managing Processes and Process Groups

 Managing Processes by Using the Command Line

 Backing Up and Restoring Process Control Information

Process Control is a tool

included with Windows 2000

Datacenter Server that

helps you organize, control,

and manage the processes

on your system and the

resources they use

Explain the purpose of the

module

Describe the list of learning

objectives

Trang 9

 Process Execution Environment

 Processes, Threads, and Fibers

 Scheduling Thread Priorities

 Scheduler

 Processor and Thread Affinity

The purpose of this section is to make sure that you understand priority, affinity, and scheduling Later in the module, you will apply these concepts when using the Process Control tool

This section begins with a discussion of processes, threads, and fibers Next, you will have an opportunity to determine how base priority is assigned This leads into an explanation of how scheduler uses the assigned base priority to allocate processor time This section concludes with a discussion about processor and thread affinity

Topic Objective

To describe the process

execution environment

Lead-in

The purpose of this section

is to make sure that you

understand priority, affinity,

and scheduling

Introduce the topic, Process

Execution Environment

The following four

supportive slides discuss

Processes, Threads, and

Fibers; Scheduling Thread

Priorities; Scheduler; and

Processor and Thread

Affinity

This section provides the

students with an opportunity

to learn about the concepts

of priority, affinity, and

scheduling These concepts

will be applied later in the

module when they use the

Process Control tool

Trang 10

Processes, Threads, and Fibers

1 Thread

Fibers +1 Thread +1 Thread

Process

Process Tree

Example.exe

Code Data

Fibers

Thread Thread

To understand the concepts and control that the Process Control tool uses, you must understand how code is executed in a computer running Windows 2000-based operating systems

There are several key elements:

 Processes

 Threads

 Fibers

 Scheduling

A process provides the resources needed to execute an application or program,

including a collection of allocated virtual memory space, executable code, data, threads, and system resources

A thread is executable code that is to be serially executed within a process A

processor or CPU executes threads, not processes, so each 32-bit application must have at least one process and one thread

A process always has at least one thread of execution, known as the primary thread, and can have multiple threads in addition to this After a thread is

scheduled to execute, the thread continues to run until it is complete, is ended

by some event, or is interrupted by a thread with higher priority (by a user action or the kernel's thread scheduler) Each thread can run separate sections of code, or multiple threads can execute the same section of code Threads that execute the same block of code maintain separate stacks

All threads of a process share its virtual address space and system resources In addition, each thread maintains exception handlers, a scheduling priority, and a set of structures that the operating system uses to save the thread context until it

is scheduled The thread context includes the thread's set of machine registers, the kernel stack, a thread environment block, and a user stack in the address space of the thread's process

Topic Objective

To identify processes,

threads, and fibers

Lead-in

To understand the concepts

and control that the Process

Control tool uses, the

student must understand

how code is executed in a

computer running

Windows 2000-based

operating systems

Describe processes,

threads, and fibers Briefly

introduce scheduling, which

will be covered in the next

two slides

In the graphic, the entire box

represents a process The

left column, including

Example.exe, with code and

data, represents a thread

The middle circle represents

a process tree The right

column represents fibers in

a thread

Trang 11

A fiber is a unit of execution that must be scheduled by the application code

Fibers run in the context of the threads that create and schedule them Each thread can schedule multiple fibers In general, fibers do not provide more advantages than a well-designed multithreaded application However, by using fibers you can make it easier to port applications that were designed to schedule their own threads From a system standpoint, a fiber assumes the identity of the thread that created it

Trang 12

Scheduling Thread Priorities

Each thread is assigned a scheduling priority, which is used by the scheduler to decide which threads should be executed at any given time The priority levels range from 0 (lowest priority) to 31 (highest priority) The priority of each thread is determined by the following criteria

The priority classes of its process are:

Topic Objective

To describe how thread

priorities are scheduled

Lead-in

Each thread is assigned a

scheduling priority, which is

used by the scheduler to

decide which threads should

be executed at any given

time

Define priority

Explain how base priority is

determined

For a more in-depth

discussion of base priority

level, see the appendix

Define dynamic priority and

explain how the system can

boost and lower dynamic

priority

Note

Trang 13

By default, the priority class of a process is NORMAL If a process creates a child process and is IDLE_PRIORITY_CLASS or

BELOW_NORMAL_PRIORITY_CLASS, the new child process inherits this class

Priority Boosts

Each thread has a dynamic priority This is the priority the scheduler uses to determine which thread to execute Initially, a thread's dynamic priority is the same as its base priority The system can boost and lower the dynamic priority

to ensure that it is responsive and that threads are receiving processor time The system does not boost the priority of threads with a base priority level between

16 and 31 Only threads with a base priority between 0 and 15 receive dynamic priority boosts

The system boosts the dynamic priority of a thread to enhance its responsiveness as follows:

 When a process that uses NORMAL_PRIORITY_CLASS is brought to the foreground, the scheduler boosts the priority class of the process associated with the foreground window so that it is greater than or equal to the priority class of any background processes The priority class returns to its original setting when the process is no longer in the foreground

 When a window receives input, such as timer messages, mouse messages, or keyboard input, the scheduler boosts the priority of the thread that owns the window

The user can control the boosting of processes that use NORMAL_PRIORITY_CLASS through the System application in the control panel

After the wait conditions for a blocked thread are satisfied, the scheduler boosts the priority of the thread For example, after a wait operation associated with disk or keyboard I/O finishes, the thread receives a priority boost

After raising a thread's dynamic priority, the scheduler reduces that priority by one level each time the thread completes a time slice, until the thread drops back to its base priority A thread's dynamic priority is never less than its base priority

Trang 14

A multitasking operating system divides the available processor time among the processes or threads that need it A system designed for preemptive

multitasking uses a scheduler to allocate a processor time slice to each thread it executes When the system switches from one thread to another, the system saves the context of the preempted thread and restores the saved context of the next thread in the queue

Windows 2000 supports preemptive multitasking, which creates the effect of simultaneous execution of multiple threads from multiple processes On a multiprocessor computer, Windows 2000 can simultaneously execute as many threads as there are processors on the computer

Fibers are not preemptively scheduled The system only schedules threads to run You schedule a fiber by switching to it from another fiber When a thread running fibers is preempted, its currently running fiber is preempted The fiber runs when its thread runs

Scheduling Execution

The operating system is designed for preemptive multitasking, and it allocates a processor time slice or quantum to each thread it executes The currently executing thread is suspended when its time slice elapses, allowing another

thread to run Threads waiting to be executed are called ready threads, and each

thread has a priority level allocated to it The scheduler maintains queues of threads with the same priority and will schedule a thread from one of the queues based on a scheduling algorithm

The length of the time slice or quantum depends on the operating system, configuration, and the processor Because each time slice is small (approximately 20 milliseconds), multiple threads appear to be executing at the same time On multiprocessor systems, where the executable threads are distributed among the available processors, several threads can be executed simultaneously

Topic Objective

To describe how scheduler

allocates a processor time

slice to each thread it

executes

Lead-in

A system designed for

preemptive multitasking

uses a scheduler to allocate

a processor time slide to

each thread it executes

Trang 15

The scheduler maintains a queue of executable threads for each priority level When a processor becomes available, the system performs a context switch The steps in a context switch are:

1 Save the context of the thread that just finished executing

2 Place the thread that just finished executing at the end of the queue for its priority

3 Find the highest priority queue that contains ready threads

4 Remove the thread at the head of the queue, load its context, and execute it Until threads that are suspended or blocked become ready to run, the scheduler does not allocate any processor time to them, regardless of their priority

The most common reasons for a context switch are:

 The time slice has elapsed

 A thread with a higher priority has become ready to run

 A running thread needs to wait

When a running thread needs to wait, it relinquishes the remainder of its time slice For example, the running thread needs to wait when it makes an operating system call for input

Priority Inversion

Priority inversion occurs when two or more threads with different priorities are

in contention to be scheduled For example, a high-priority thread waiting for resources from a low-priority thread can result in the low-priority thread not being scheduled, while the high-priority thread consumes all its allocated time waiting for the low-priority thread to return data

The scheduler solves this problem by randomly boosting the priority of the ready threads (in this case, the low-priority lock-holders) The low-priority thread runs long enough to exit the critical section, and the high-priority thread can enter the critical section If the low-priority thread does not get enough CPU time to exit the critical section the first time, it gets another chance during the next round of scheduling

Trang 16

Processor and Thread Affinity

Limit thread execution to a subset of the available CPUs

Limit thread execution to a subset of the available CPUs Thread 1 - Affinity 6

Processor 1

Processor 2

Processor 3

Processor 4

Processor 5

Processor 6

Processor 7

Processor 8

Windows 2000 uses a symmetric multiprocessing (SMP) model to schedule threads on multiple processors With this model, any thread can be assigned to any processor Therefore, scheduling threads on a computer with multiple processors is similar to scheduling threads on a computer with a single processor However, the scheduler has a pool of processors so that it can schedule threads to run concurrently Scheduling is still determined by thread priority However, on a multiprocessor computer, you can also affect

scheduling by setting thread affinity

Thread affinity forces a thread to run on a specific subset of processors A mask function is used to specify thread affinity for all threads of the process

Setting thread affinity should generally be avoided, because it can interfere with the scheduler's ability to schedule threads effectively across processors This can decrease the performance gains produced by parallel processing An appropriate use of thread affinity is testing each processor

Explain how a thread can be

assigned to any processor

Trang 17

Job Objects

Job Object A

Job Object B

Process B

Process A

Process Group 1

Process Group 2

es D

es E

When managing the applications on a server, it is often necessary to treat a set

of processes as a single group For example, if an application has several dependent processes, you can group those processes together so that you have a single point of management for the application

Process Control uses job objects to group together one or more processes Grouping related processes enables management and tracking of the process group as a single unit Job objects can be created programmatically on all versions of Windows 2000 and can be created by the Process Control tool in Windows 2000 Datacenter Server

A job object is a kernel object that is:

 Namable Each job object can have a unique name

 Securable Each job object is separate and secure

 Sharable Each job object is accessible to other objects and to the operating

system

 Inheritable Properties of job objects can be inherited

Job objects control attributes of the processes associated with them; for example, a mask attribute defines the processors on which a thread can run Operations performed on the job object affect all the processes associated with the job object

A job object can enforce limits on each associated process For example, limits can be defined for working set size, process priority, and end-of-job time limit You can create Process Control rules that prevent processes from consuming too much memory or CPU time If a process associated with a job object attempts to acquire resources that would exceed a set limit, the function calls are ignored After you associate a process with a job object, the association cannot be broken

often necessary to treat a

set of processes as a single

group

Explain the purpose of job

objects

Define job object

Describe how job objects

collect and retain accounting

information

Describe how to control

child processes in a job

object

Trang 18

Job objects prevent processes from changing their own limits Although a given process may be able to alter its own priority and affinity under normal

circumstances, that same process cannot do so from within a job object

Accounting Information

A job object collects and retains accounting information (statistics) for all its associated processes, including those that have terminated This gives you the ability to view meaningful data about a group of processes or across a series of process executions or both

This information is available only while the job object exists After the job object terminates, the accounting information is lost Process Control in Datacenter Server includes a monitoring facility that retains the accounting information from job objects that have terminated The information is available for administrative purposes for all job objects that have run The job object retains accounting information for the following:

 Per process user time limit

 Per job user time limit

 Limit flags

 Minimum working set size

 Maximum working set size

 Active process limit

 Affinity

 Priority class

 Scheduling class

Controlling Child Processes in a Job Object

A child process is created by a process associated with a job object By default,

child processes are also associated with the job object

Processes running in a job object can create child processes, which by default are part of the process tree controlled by the job object The job object has parameters that allow control of the child processes, so a process that is not part

of the same process tree can be created Following is a list of parameters

 Breakaway OK Controls what happens when a process in the group

requests that a child process break away from the group If enabled, the child process begins execution outside the group If not enabled, the child process fails

 Breakaway From Job When enabled, the child process begins execution outside the group

 Silent Breakaway OK When enabled, a process started within the group

always breaks away After the process leaves the group, it is eligible to be placed in a group by Process Control during a management scan

If the job has the extended limit JOB_OBJECT_LIMIT_BREAKAWAY_OK and the process was created with the CREATE_BREAKAWAY_FROM_JOB flag, its child processes are not associated with the job If the job has the extended limit JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK, no child processes are associated with the job

Trang 19

 Process Control Concepts

 Process Control Components

 Process Control Functionality

 Process Control User Interface

Process Control is made up of a user interface (UI) and services for controlling and managing processes You can use Process Control to manage individual processes, group these processes together, and manage the grouped processes to help maintain availability as defined by the applicable service level agreements (SLAs)

The services that make up Process Control use the job objects to limit, report, and constrict the activity of processes on a server running Datacenter Server With Process Control, you can manage application performance by limiting the memory available to processes, setting process priority, and assigning processes

to run only on certain processors

Enforcing limits at the process level ensures that a number of heterogeneous applications can successfully coexist on a single server Because you are creating reserved spaces for certain processes, these processes will not consume system resources beyond what you have allowed them This guarantees

application performance within the boundaries you have set

Process Control helps to ensure a specified level of performance when running heterogeneous applications on a single server that is running Datacenter Server by:

 Increasing application isolation Processes are constrained by the job

objects in which processes are created If a process fails, it can affect only those processes created in the same job object

 Managing large system resources In systems with very large memory sizes

and multiple CPUs, it is possible to constrain the memory and CPU resources available to a process group

 Improving server management Process groups allow an application’s

processes to be constrained For example, management controls such as time limits can be imposed on the process groups

Process Control is made up

of a user interface (UI) and

services for controlling and

managing processes

Introduce the Process

Control tool

Explain how Process

Control ensures a specified

level of performance when

running heterogeneous

applications on a single

server that is running

Datacenter Server

The following three

supportive slides discuss

Process Control

components, Process

Control functionality, and the

Process Control user

interface

Trang 20

 Preventing processes from consuming too much memory or CPU time Hard

limits can be set on memory consumed by processes, and soft limits can be applied to process groups Process groups can have their execution time limited

 Scaling applications to the appropriate number of CPUs Process groups

can be limited to run on a subset of available CPUs

This section begins by introducing the Process Control components that control and manage processes This is followed by a discussion about how Process Control depends on these components to function The section concludes with a discussion about how the Process Control UI can be scripted, managed with graphical tools, or controlled from the command line

Trang 21

Process Control Components

 Process Control Service

 Process Control Mediator

 Process Control Snap-in

 Process Control Command-line Utility

 Process Control Console

 Process Control Help Files

Process Control is made up of several components that control and manage processes These components include a service, user interface (UI), and command-line utility The services that make up Process Control use job objects to limit, report, and constrict the activity of processes on a server running Datacenter Server Process Control retains information about running and completed process groups The following table explains the Process Control components

Process Control service

that must be installed and started on the target computer

Process Control mediator

Control service and is used to preserve information when the service starts and stops Process Control

snap-in

snap-in that is a client of the Process Control service It is a graphical user interface from which you can configure and manage processes and process groups

Process Control command-line utility

client of the Process Control service It provides

a command-line interface from which you can configure and manage processes and process groups

Process Control console

file for Process Control that runs in MMC Process Control

Help

procedural, and troubleshooting information about Process Control

Topic Objective

To describe the components

of Process Control

Lead-in

Process Control is made up

of several components that

control and manage

processes

Briefly explain the

components in the table

The following slide provides

more details about how the

components function,

except for Process Control

Help

Trang 22

Process Control Functionality

 The Process Control Service

 The Process Control Mediator

 Files to Manage a Server from a Workstation

Process Control functionality depends on the Process Control service, the Process Control mediator, and the user interface The service and mediator are started by default on all servers running Datacenter Server and the user interface can connect either locally or remotely to the running services

The Process Control Service

The central component of Process Control is the Process Control service ProcConSvc.exe, the Process Control service, runs on each computer running Datacenter Server The service monitors all processes starting and stopping on the system and applies the rules you have defined In the case of process groups, the service creates job objects The job objects then enforce the rules you have defined

The Process Control Mediator

To preserve process group and accounting information across all service start and stop events, the Process Control mediator, ProcConMD8.exe, maintains a copy of the group and accounting information used to create a job object If a process group (controlled by a job object) starts, runs to completion, and stops without the mediator, then the accounting information is lost when the job object exits The Process Control mediator copies the information from the job object at completion and retains this information for display in the Process Control UI

If you stop both the service and the mediator:

 You lose accounting information about running process groups

 Names are deleted

 The processes appear as if they were no longer in their groups

Topic Objective

To describe how the

components function

Lead-in

Process Control functionality

depends on the Process

Control service, the Process

Control mediator, and the

user interface

Explain how the Process

Control service monitors all

starting and stopping on the

system and applies the rules

you have defined

Explain how the Process

Control mediator preserves

process groups across all

service start and stop

events

Explain which files must be

installed to manage a server

from a workstation

Key Points

To avoid losing data, do not

stop the mediator and the

service at the same time

Trang 23

Windows 2000 continues to control the processes according to the group’s rules, but the processes cannot be reassigned to their properly named groups when Process Control restarts In addition, system log notifications are lost for those groups

To avoid losing data, do not stop the Process Control mediator and service at the same time

Files to Manage a Server from a Workstation

The following table specifies which files must be installed before you can manage a server from a workstation

Computer Requirements

Windows 2000 Datacenter Server

user interface) If you want Help to be available from the MMC snap-in, copy ProcCon.chm to the client as well (by default, the

\Winnt\Help directory)

To use the Process Control snap-in on the client workstation, you must register the dynamic-link library (.dll) file in MMC To do this, at a

command prompt, type regsvr32 proccon.dll and then start MMC On the

Console menu, click Add/Remove Snap-in, and then add the Process Control

snap-in

Important

Important

Trang 24

Process Control User Interface

 MMC Console and Snap-in

 Command-Line Utility

You can access the Process Control service by using either the MMC console and snap-in or the command-line utility

The MMC Console and Snap-in

ProcCon.msc is a preconfigured MMC console file that opens and loads the Process Control snap-in (ProcCon.dll)

Starting Process Control from the Administrative Tools menu launches the

preconfigured MMC snap-in You can use this snap-in to graphically view and manage:

 Rules

 Processes

 Process groups

The Command-Line Utility

ProcCon.exe is a stand-alone command-line utility that runs on Windows 2000 clients but has no special dependencies The command-line utility can be used for both local and remote Process Control

The Process Control command-line utility uses a series of command-line switches that supply the required data to describe the operation to be performed The Process Control command-line utility also allows the scripting of Process Control configurations and changes to those configurations

Topic Objective

To describe the Process

Control user interface

Lead-in

You can access the Process

Control service by using

either the MMC console and

snap-in or the command-line

utility

Explain how students can

manage the Process Control

service by using the MMC

snap-in or the command-line

utility

Explain how students can

use the MMC snap-in to

graphically view and

manage rules, processes,

and process groups Rules,

processes, and process

groups are covered later in

this module

Explain how the

command-line utility allows the

scripting of Process Control

configurations and changes

to those configurations

Trang 25

Rules, Processes, and Process Groups

Process Control

Action View

Rules Processes Process Groups

Process Control (Local)

Rules Processes Process Groups

Process Control helps you manage and control the resources that processes use

on your system by applying rules that you define You can apply alias and execution rules to a process, and you can group those processes into one or more process groups

In the Process Control console tree, you can define, view, and manage rules, processes, and process groups

Rules

Rules define process limitations and display information that is applied by

Process Control when your process starts

Rules appear in the expanded Process Control console tree

Processes

A process is an instance of a program running in a computer When

applications run, they create processes that use system resources On a computer managed by Process Control, each process has an alias assigned to it

by a user-defined Process Alias rule or by the default rule that associates a process with its image name

By using the Process Control MMC snap-in or the command-line utility, you can view, manage, and control the processes running on your system

Processes appear in the expanded Process Control console tree When you click

Processes, the details pane displays a list of processes running on the target

computer, as well as information about each process If you click the processes, you can configure the list to view:

 All processes (the default view)

 Only processes that are running

 Only managed processes (processes that are associated with a Process Control rule)

Topic Objective

To identify rules, processes,

and process groups

Lead-in

Process Control helps you

manage and control the

resources that processes

use on your system by

applying rules that you

define

Define rules, processes, and

process groups

Introduce the user interface

for Process Control You

can present the slide or

demonstrate the actual

screen by opening Process

Control

Trang 26

Information about each process is organized into columns, some of which remain empty until the process is running or until the process has a Process Control rule associated with it

Process Groups

A process group is a container for a designated group of processes that have

been collected by a user for simplified management Process groups contain one

or more related or unrelated processes that can then be managed as a group by using the Process Group Execution rules you define

Process groups appear in the expanded Process Control console tree When you

click Process Groups, the details pane displays a list of process groups you

have defined by using Process Control You can configure the list to view:

 All process groups (the default)

 Only process groups that are running, which includes any group that has started to run whether it has any active member processes

 Only managed process groups, which are process groups associated with a Process Control rule that modifies the behavior of the group in at least one set of conditions You can also obtain information on a group that is not managed

The process group statistics reflect all processes that run as members of the group, not just the current members

Process Control uses standard Windows application programming interfaces (APIs) and may be constrained by security restrictions that an application has placed on its processes or by other security policies put in place

by the system administrator As a result, some processes may not be visible to Process Control

Note

Trang 27

Configuring the Process Control Service

Process Control Properties

Item name: Value:

Mediator File Version 1.0.1.23 Mediator Product Version

Memory Page Size Number of Processors

The Process Control service has two associated parameters that can be configured by the administrator

 The process scan interval sets the number of seconds between scans of all

Process Control managed processes For example, setting the process scan interval to a large value reduces the overhead of Process Control but may allow runaway processes to request excess resources before they are detected This can slow other processes and process groups and adversely affect the performance of the server running Datacenter Server

 The request timeout interval sets the number of milliseconds that the UI

waits for a response from the Process Control service before reporting an error The UI, service location, and the current load on the server running Datacenter Server can influence this setting For example, if the UI is connected to a remote server running Datacenter Server over the TCP/IP network, the response of the network and current load on the server being accessed can require an increased timeout interval

To adjust the process scan interval and the request timeout interval, use the

Service tab of the Process Control Properties dialog box The process scan

interval is measured by the number of seconds between scans, and the request timeout interval is measured by the number of milliseconds before time-out occurs

Process Scan Interval

The Process Control service periodically checks the server for new processes and for the status of currently managed processes The process scan interval is the time between these periodic checks Depending on the process scan interval and other factors local to the server, there is a delay between the time a new process is created and the time Process Control discovers and manages that process If a process runs to completion faster than the process scan interval, it may go undetected and so be unaffected by a given Process Control rule

Topic Objective

To configure the Process

Control service

Lead-in

The Process Control service

has two associated

parameters that can be

configured by the

administrator

This slide covers the

concepts of process scan

interval and request timeout

interval in preparation for

the demonstration on the

next slide

Delivery Tip

You may want to conduct

the demonstration on the

following slide at the same

time you cover this slide

Trang 28

Request Timeout Interval

The request timeout interval is the amount of time that the Process Control snap-in waits for confirmation of a change or request If the Process Control service does not respond to the request for a change within the specified interval, the Process Control snap-in stops waiting for a response and a log entry is generated

On a very busy server, the Process Control service may not respond to the Process Control snap-in within the specified interval but may still complete the change or request

Information displayed by the snap-in may be out of date, but you can continue

to use the Process Control snap-in after a time-out error When a time-out error occurs, you cannot tell whether the server received the request or whether the server completed or rejected the request You must look at the data on a refreshed view before deciding to resubmit the request

If the server is really busy, do not set the time-out to the lowest number (1)

Note

Tip

Trang 29

Demonstration: Tuning the Process Scan Interval

In this demonstration, the instructor modifies the process scan interval so that Process Control checks for new processes more frequently than the 60-second default interval

Click Start, point to Programs, point to Administrative Tools, and click

Process Control

In the console tree, right-click Process Control (Local), and select

Properties

1 In the Process Control on Local Computer Properties dialog box, select the Service tab

2 In the Process scan interval (seconds) box, type 5

3 Click OK

Click Start, click Run, type CMD and click OK

1 At the command prompt, type net stop proccon and press ENTER

2 At the command prompt, type net start proccon and press ENTER

Topic Objective

To demonstrate how to tune

the process scan interval

Lead-in

In this demonstration, I will

modify the process scan

interval so that Process

Control checks for new

processes more frequently

than the 60-second default

interval

Demonstrate how to tune

the process scan interval

Trang 30

Process Control (Local)

Rules

Process Alias Rules Process Execution Rules Process Group Execution Rules Processes

Process Groups

The Process Control tool uses rules to describe and control processes There are three types of rules that you can define, manage, and view These include Process Alias rules, Process Execution rules, and Process Group Execution rules

Process Alias Rules

Process Control makes it easy to identify processes in a meaningful way by assigning each process an intuitive alias based on a list of Process Alias rules that you define

Process Execution Rules

After a process has an associated process alias, you can define a Process Execution rule that controls how and where the process runs Process Control matches a process alias name with a Process Execution rule that has the same name

Process Group Execution Rules

A Process Group Execution rule manages and controls the execution of processes grouped together in a process group by one or more Process Execution rules

Topic Objective

To identify Process Alias

rules, Process Execution

rules, and Process Group

Execution rules

Lead-in

The Process Control tool

uses rules to describe and

control processes

Introduce Process Alias

rules, Process Execution

rules, and Process Group

Execution rules Briefly

explain what they are Each

of these concepts is

explained in detail later in

the module

Delivery Tip

You may want to open

Process Control and show

students an actual screen

with Rules expanded

Trang 31

Defining Process Alias Rules

Define New Process Alias Rule

General

OK Cancel Process Alias Rule

Help

Sub-Directory Name Image Name String Type of match:

Match string:

Process alias assigned on a match:

Rule description or comment:

notepad.exe

Notepad Alias Rule for instances on Notepad

Process Control identifies processes in a meaningful way by assigning each process an intuitive alias based on a list of Process Alias rules that you define When Process Control detects a new process starting, it assigns the process a name To do this, Process Control uses the following method:

1 Examines the first rule in the Process Alias rule list

2 Attempts to match a subdirectory name, image name, or string If the match

is successful, Process Control assigns the alias name specified by the rule to the process If the match is unsuccessful, Process Control continues with the next rule in the list

3 Uses the image name to identify the process, in the event that no rule provides a match

Types of Match

A Process Alias rule can attempt to match a subdirectory name, image name, or string

Types of match Description

file Subdirectory names appear between backward slashes (\)

in the path

When you create a process alias based on the image name, Process Control matches the name of the executable file, regardless of its path The image name is the portion of the full name following the last backward slash and is the name of the actual file on disk

with the specified match string

way by assigning each

process an intuitive alias

based on a list of Process

Alias rules that you define

Explain in detail what

Process Alias rules are and

what they do This slide

covers the concepts of

defining a Process Alias rule

in preparation for the

demonstration on the next

slide

Discuss the Types of match,

Match string, and Process

alias assigned on a match

areas of the Define New

Process Alias Rule dialog

box

Delivery Tip

You may want to conduct

the demonstration on the

following slide at the same

time you cover this slide

Trang 32

Match String

Enter text in the Match string box that matches the type selected in the Type

of match area The Process Alias rule can attempt to match:

 A path

 A portion of a path

 A portion of the image name (.exe name)

You can use wildcard characters in match strings You can use * for all remaining characters and ? for any character in any position You can also use

environment variables in the strings Match strings are not case sensitive

Process Alias Assigned on a Match

After Process Control finds a match, it assigns the alias name specified in the Process Alias rule

Alias names can include any characters except a backward slash (\), a comma,

or a double quotation mark (") You can combine text with any of these specifiers

Specifiers Description

is replaced by the image name

subdirectory match For example, if "MS*" is the match string, "<D>" will be replaced by "MSSQL" if that is the name of the subdirectory matched and "MSOFFICE" if "MS*" matched that subdirectory

possible to exclude from the list the processes that are not of interest For example, hiding all the processes that run out of %SystemRoot% excludes system processes and narrows the list to application processes

Hiding All but Select Names

Because the order in which the Process Alias rules are applied can be important,

the rule list cannot be sorted alphanumerically Instead, you must click Move

Up or Move Down when you right-click a rule to promote or demote the rule

one level in the ordered list, as appropriate

If you want to view only the programs that run out of a particular directory, the first rule in the process alias list could assign the desired name to any program running from the directory in question; the second rule could match an image name with a match string of "*" (always match) and an assigned name of <H> The first rule will name all the processes of interest, and the second rule will hide all the others

Differentiating Identical Names

If you have two programs on your system with identical names or two versions

of the same product, create Process Alias rules that match on a directory or a string and assign different alias names to the image files so that you can easily distinguish one from the other

Trang 33

Demonstration: Defining and Testing a Process Alias

Rule

In this demonstration, the instructor defines and tests a new Process Alias rule for the process called notepad.exe

On the taskbar, click Start, point to Programs, point to Administrative

Tools, and click Process Control

1 In the console tree, expand Rules, and then click Process Alias Rules

2 In the details pane, right-click Default Alias Rule, and then click Insert

Rule

3 In the Define New Process Alias Rule dialog box, in the Type of match area, click Image Name

4 In the Match string box, type notepad.exe

5 In the Process alias assigned on a match box, type Notepad Alias

6 In the Rule description or comment box, type Rule for instances of

In this demonstration, I will

define and test a new

Process Alias rule for the

process called notepad.exe

Demonstrate how to define

and test a new Process

Alias rule

Trang 34

 To verify that the Process Alias rule will be applied to the process when

it is executed

1 In Process Control, in the console tree, click Processes

2 In the details pane, locate the process alias called Notepad Alias

3 On the taskbar, click Start, and then click Run In the Open box, type

notepad.exe and then click OK to start an instance of Microsoft Notepad

4 In the Process Control Processes details pane, press F5 to refresh the details

5 Verify that the image name for Notepad Alias is notepad.exe

6 Right-click Notepad Alias in the Processes details pane, and select

Properties

7 Look at the Notepad Alias on Local Computer Properties dialog box, and

notice that the process has no management rule defined and that a button

called Define Process Execution Rule is displayed

8 To exit the Notepad Alias on Local Computer Properties dialog box, click OK

9 In the Processes details pane, right-click Notepad Alias, and then click End

Process

Trang 35

 Defining Process Execution Rules

Naming a Process Alias

Assigning a Process to a Process Group

Applying Affinity

Applying Priority

Applying Memory Limits

Demonstration

A Process Execution rule can associate a rule with a process alias and specify the affinity, priority, and working set of an individual process

A Process Execution rule controls a process associated with a process alias Process Control uses the Process Execution rule to control how and where the process runs

Topic Objective

To define Process

Execution rules

Lead-in

A Process Execution rule

can associate a rule with a

process alias and specify

the affinity, priority, and

working set of an individual

process

Explain in detail what

Process Execution rules are

and what they do

Introduce the topic Defining

Process Execution Rules

The following five supportive

slides discuss naming a

process, assigning a

process to a process group,

applying affinity, applying

priority, and applying

memory limits The sixth

supportive slide provides a

demonstration

This section covers the

concepts of defining a

Process Execution rule in

preparation for the

demonstration at the end of

this section

Delivery Tip

You may want to conduct

the demonstration at the

same time you cover this

section

Trang 36

Naming a Process Alias

Define Process Execution Rule

Process Alias

Select the Alias that this rule applies to

< Back Next > Next > Cancel

Indicate the process alias that this execution rule applies to The alias name is assigned by on of the process alias rules.

A process alias name may contain any characters except comma, \, or “ and is

up to 63 characters long Leading or trailing spaces are not allowed.

Process alias: Notepad Alias Description or comment: Notepad Execution Rule

This graphic shows the first page of the wizard When you define a Process

Execution rule, the Process alias box appears dimmed and the process alias

name is already designated You can enter a comment that will appear in the user interface

You can also create a Process Execution rule The only difference between the

Define Process Execution Rule Wizard and the Create Process Execution Rule

Wizard is the Process alias box When you use the Create Process Execution Rule Wizard, you must type the process alias name in the Process alias box When you use the Define Process Execution Rule Wizard, the Process alias

box appears dimmed and the process alias name is already designated

The following pages present the Define Process Execution Rule Wizard; later in the module there is also a demonstration of how to use this wizard To use the Create Process Execution Rule Wizard, in the console tree, right-click

Process Execution Rule, and then click New Process Execution Rule

Topic Objective

To name a process alias

Lead-in

This graphic shows the first

page of the Define Process

Execution Rule Wizard

Briefly explain the Process

Alias page of the Define

Process Execution Rule

Wizard

Explain that the only

difference between defining

and creating a Process

Execution rule is the

Process alias box on the

Process Alias page

Delivery Tip

You may want to

demonstrate how to create a

Process Execution rule

versus define a Process

Execution rule

Note

Trang 37

Assigning a Process to a Process Group

Define Process Execution Rule

Group Membership

Choose whether to put this process alias in a group

< Back Next > Next > Cancel

A process can be managed by itself or be placed in a process group Groups offer more management options including CPU time, memory, and number of processes

Processes are placed in the group only when the ‘Execute within…’ box is checked.

A process group name may contain any characters except comma, \, or “ and is up to

63 characters long Leading or trailing spaces are not allowed.

If the group does not exist, a new group rule will be created.

Execute within a process group

You can use process groups to manage one or more processes with a common set of limits applied at the group level A process group, with an associated Process Group Execution rule, can be used to control processes within a process group No individual process can override group limits that have been set

A process executes within a particular process group and becomes part of that group when specified by the Process Execution rule associated with that process

You can use a Process Execution rule to assign a process to membership within

a process group If you do not select the Execute within a process group

check box, the Process Execution rule remains intact If you select the check box, you must choose an existing process group or create a new one

If you specify a group that does not exist in the wizard, Process Control creates

a group when you save or update the Process Execution rule

Topic Objective

To assign a process to a

process group

Lead-in

You can use Process

Groups to manage one or

more processes with a

common set of limits applied

at the group level

Explain when you would and

when you would not want to

select the Execute within a

process group check box

Trang 38

Applying Affinity

Define Process Execution Rule

Affinity

Decide which CPUs to use when running the process or group

< Back Next > Next > Cancel

Processor affinity selects which processors (CPUs) to use for execution.

This setting is only used when the process is not in a process group When affinity is not applied, threads in the process can run on any CPU This affinity selection is applied only when the ‘Apply affinity’ box is checked.

Apply affinity:

0 16 32 48

15 31 47 63

You use the affinity setting to specify which subset of the available processors a given process or process group can use By controlling which processes or process groups run on particular processors, you can partition available resources independently of the applications' relative workloads If one process group becomes more active or more important than the others, you can change affinity settings to provide that process group with a larger share of available resources

If a subset of available processors is not specified, then the process group runs

on all available processors

If you attempt to select a processor that is not available in the processor mask, the check box appears dimmed, indicating that a processor is not available

If a process is not a member of a group, Process Control does not control its affinity setting When you associate a process with a Process Execution rule that specifies a particular affinity setting, Process Control scans and manages the setting After the rule is in place, Process Control checks the affinity setting with each scan interval If the process has programmatically changed its own affinity, Process Control resets the affinity to the appropriate value

Topic Objective

To apply affinity

Lead-in

The affinity setting is used to

specify which subset of the

available processors a given

process or process group

can use

Explain how to apply affinity

Relate this discussion to the

slide titled “Processor and

Thread Affinity,” which was

covered at the beginning of

this module

Note

Trang 39

Applying Priority

Define Process Execution Rule

Priority

Decide which Windows priority to use when running the process or group

< Back Next > Next > Cancel

The priority setting determines relative CPU attention Higher priority processes receive more CPU time than lower priority ones.

This setting is only used when the process is not in a process group When priority is not applied, threads in the process typically run at normal priority This priority selection

is applied only when the ‘Apply priority’ box is checked.

Apply priority:

Realtime High Above normal Normal Below normal Low

Realtime High Above normal Normal Below normal Low

When you associate a process with a Process Execution rule that specifies a

particular priority, Process Control monitors the priority If a process is not a

member of a group, Process Control does not affect its priority setting

You use the priority setting to specify the importance of a process or process group relative to other executing processes A process with a high priority is allocated more processor time than processes with a low priority

The priority setting for a process group is applied to all processes running within that group A process cannot change its own priority after it is in a group

Process Control checks the priority setting with each scan interval, and if the process has programmatically changed its own priority, Process Control resets the priority to the value you specified for the group priority

Topic Objective

To apply priority

Lead-in

When you associate a

process with a Process

Execution rule that specifies

a particular priority, Process

Control monitors the priority

Explain how to apply

priority Relate this

discussion to the slides titled

“Scheduling Thread

Priorities” and “Scheduler,”

which were covered at the

beginning of this module

For Your Information

When you apply priority

within a Process Execution

rule, Process Control only

monitors the priority This

means that an event can be

viewed in Event Viewer if

the priority goes above or

below the setting Process

Control only applies a

priority setting when a

process is a member of a

process group

Trang 40

Applying Memory Limits

Define Process Execution Rule

Working Set

Decide what working set limits to apply to the process or processes running in the group

< Back Finish Cancel

The working set of a process consists of the portion of the process’s virtual memory that has been allocated physical memory Windows attempts to keep the physical allocation of each process between the specified limits.

Group working set limits are hard limits that apply to each process in the group If a process needs physical memory beyond the maximum it will page against itself rather than obtain additional pages from memory – even if the system is not busy.

Apply working set limits:



Minimum memory (Kilobytes): 1,024 Maximum memory (Kilobytes): 2,048

The working set limits put an upper and lower limit on the amount of physical memory a process or process group can use at any given moment If a process exceeds its allotted memory, Windows 2000 simply frees other pages in the working set or allows the working set to exceed the upper limit

If a process is managed by a Process Execution rule, the working set limits describing the upper and lower limits of the amount of physical memory do not impose hard limits For a process managed by a Process Execution rule, an event is logged in the system log when the limits are exceeded However, the process can continue to allocate physical memory to itself

If you want to impose a hard limit on a process working set, add the process to

a process group, and apply the desired limit to the group Process Group Execution rules impose hard limits on the working set for a given process

Topic Objective

To apply memory limits

Lead-in

The working set limits put an

upper and lower limit on the

amount of physical memory

a process or process group

can use at any given

moment

Describe the concept of

memory limits as well as

how to fill out the fields on

this Working Set page of

the wizard

Ngày đăng: 24/01/2014, 10:20