+ All Categories
Home > Documents > Computers on Cruise Control Creating Adaptive Systems with Control Theory Ricardo Portillo The...

Computers on Cruise Control Creating Adaptive Systems with Control Theory Ricardo Portillo The...

Date post: 29-Dec-2015
Category:
Upload: cathleen-butler
View: 212 times
Download: 0 times
Share this document with a friend
23
Computers on Cruise Computers on Cruise Control Control Creating Adaptive Systems Creating Adaptive Systems with Control Theory with Control Theory Ricardo Portillo The University of Texas at El Paso [email protected]
Transcript
Page 1: Computers on Cruise Control Creating Adaptive Systems with Control Theory Ricardo Portillo The University of Texas at El Paso raportil@miners.utep.edu.

Computers on Cruise Computers on Cruise ControlControl

Creating Adaptive Systems Creating Adaptive Systems with Control Theorywith Control Theory

Ricardo PortilloThe University of Texas at El Paso

[email protected]

Page 2: Computers on Cruise Control Creating Adaptive Systems with Control Theory Ricardo Portillo The University of Texas at El Paso raportil@miners.utep.edu.

The Ultimate Goal: The Ultimate Goal: PerformancePerformance

Performance GoalsPerformance Goals Response Time; Throughput; Execution Response Time; Throughput; Execution

Time; CPU UtilizationTime; CPU Utilization

How do we increase performance?How do we increase performance? Tune the application to the systemTune the application to the system Tune the system to the applicationTune the system to the application

I’m going to talk about thisI’m going to talk about this

Page 3: Computers on Cruise Control Creating Adaptive Systems with Control Theory Ricardo Portillo The University of Texas at El Paso raportil@miners.utep.edu.

Tuning the System to the Tuning the System to the ApplicationApplication

1.1. Determine the resource needs of the Determine the resource needs of the applicationapplication

2.2. Determine what system parameters Determine what system parameters affect the application’s performanceaffect the application’s performance

3.3. Tune these parameters for optimal Tune these parameters for optimal management of the application’s management of the application’s resourcesresources

Page 4: Computers on Cruise Control Creating Adaptive Systems with Control Theory Ricardo Portillo The University of Texas at El Paso raportil@miners.utep.edu.

The Problem: Computer The Problem: Computer ComplexityComplexity

► Computers and applications are growing Computers and applications are growing largerlarger

► Systems are becoming more heterogeneousSystems are becoming more heterogeneous► Workload characteristics change Workload characteristics change

rapidlyrapidly Directory Directory and Security and Security

ServicesServicesExistingExisting

ApplicationsApplicationsand Dataand Data

BusinessBusinessDataData

DataDataServerServer

WebWebApplicationApplication

ServerServer

Storage AreaStorage AreaNetworkNetwork

BPs andBPs andExternalExternalServicesServices

WebWebServerServer

DNSDNSServerServer

DataData

Dozens of systems and applications

Hundreds of components

Thousands of tuning

parameters

Page 5: Computers on Cruise Control Creating Adaptive Systems with Control Theory Ricardo Portillo The University of Texas at El Paso raportil@miners.utep.edu.

The Solution: AutomationThe Solution: Automation

RequirementsRequirements►MonitorMonitor if performance goals are if performance goals are

being metbeing met►AdaptAdapt when performance changes when performance changes►GuaranteeGuarantee that an adaptation will that an adaptation will

produce the desired effect at the right produce the desired effect at the right timetime

Page 6: Computers on Cruise Control Creating Adaptive Systems with Control Theory Ricardo Portillo The University of Texas at El Paso raportil@miners.utep.edu.

Analogous ScenarioAnalogous Scenario

The cruise control in you carThe cruise control in you car

Requirements:Requirements: MonitorMonitor desired velocity is being metdesired velocity is being met AdaptAdapt accelerator when velocity changes accelerator when velocity changes GuaranteeGuarantee that changes produce the that changes produce the

desired velocitydesired velocity

Cruise Control is implemented Cruise Control is implemented with Control Theory!with Control Theory!

Page 7: Computers on Cruise Control Creating Adaptive Systems with Control Theory Ricardo Portillo The University of Texas at El Paso raportil@miners.utep.edu.

What is Control Theory?What is Control Theory?

Control Theory is:Control Theory is:► A branch of engineering and mathematicsA branch of engineering and mathematics► Deals with systems that change over timeDeals with systems that change over time

Main Goal:Main Goal: Given a desired output from a system, Given a desired output from a system,

manipulate system inputs to constantly manipulate system inputs to constantly achieve that output.achieve that output.

Fundamental Concept:Fundamental Concept: The Feedback LoopThe Feedback Loop

Page 8: Computers on Cruise Control Creating Adaptive Systems with Control Theory Ricardo Portillo The University of Texas at El Paso raportil@miners.utep.edu.

The Feedback LoopThe Feedback Loop

Controller

Target System

DisturbanceInput

Measured Output

DesiredOutput

ControlInput

Desired/Measured Output:Desired/Measured Output: Performance Metrics Performance Metrics Control Input:Control Input: Tuning Parameters Tuning Parameters Disturbance Input:Disturbance Input: Workload Changes Workload Changes

Page 9: Computers on Cruise Control Creating Adaptive Systems with Control Theory Ricardo Portillo The University of Texas at El Paso raportil@miners.utep.edu.

What’s Inside the Controller?What’s Inside the Controller?

► A A difference equationdifference equation describing the next output as describing the next output as a function of the current input and output:a function of the current input and output:

y(k+1) = a*y(k) +b*u(k)y(k+1) = a*y(k) +b*u(k)

y(k+1) = Desired Performancey(k+1) = Desired Performancey(k) = Current Performancey(k) = Current Performanceu(k) = Parameter value to meet desired u(k) = Parameter value to meet desired

performanceperformance

► Can be rewritten as:Can be rewritten as: u(k) = [y(k+1) - a*y(k)] / bu(k) = [y(k+1) - a*y(k)] / b

Page 10: Computers on Cruise Control Creating Adaptive Systems with Control Theory Ricardo Portillo The University of Texas at El Paso raportil@miners.utep.edu.

The ControllerThe Controller

ControllerController

u(k) = [y(k+1) - a*y(k)] / u(k) = [y(k+1) - a*y(k)] / bb

Desired Outputy(k+1) Control Input

u(k)

Measured Outputy(k)

Receive

•Current performance y(k)

•Desired performance y(k+1)

Produce

•Required parameter value u(k)

Page 11: Computers on Cruise Control Creating Adaptive Systems with Control Theory Ricardo Portillo The University of Texas at El Paso raportil@miners.utep.edu.

Difference Equation Difference Equation FlexibilityFlexibility

►Want to look more than one time step in Want to look more than one time step in the past? Use an ARX model:the past? Use an ARX model:

y(k+1) = ay(k+1) = a11y(k)+…+ay(k)+…+anny(k-n+1)+by(k-n+1)+b11u(k)+…+bu(k)+…+bmmu(k-m+1)u(k-m+1)

►Want more than one performance goal Want more than one performance goal satisfied? Produce a separate equation satisfied? Produce a separate equation for each performance goal:for each performance goal:CPU(k+1) = aCPU(k+1) = a1111CPU(k) + aCPU(k) + a1212MEM(k)+bMEM(k)+b1111uu11(k)+b(k)+b1212uu22(k)(k)

MEM(k+1) = aMEM(k+1) = a2121CPU(k) + aCPU(k) + a2222MEM(k)+bMEM(k)+b2121uu11(k)+b(k)+b2222uu22(k)(k)

Page 12: Computers on Cruise Control Creating Adaptive Systems with Control Theory Ricardo Portillo The University of Texas at El Paso raportil@miners.utep.edu.

Getting your Difference Getting your Difference EquationEquation

1)1) Determine your system scopeDetermine your system scope

2)2) Choose your representative workloadChoose your representative workload

3)3) Run your experiments:Run your experiments:► Constantly change your parameters while workload is Constantly change your parameters while workload is

runningrunning► Keep track of the current parameter and performance Keep track of the current parameter and performance

values and of subsequent performance valuesvalues and of subsequent performance values

4)4) Perform a scatter plot analysis on your data Perform a scatter plot analysis on your data to estimate the coefficients of your equationto estimate the coefficients of your equation

5)5) Evaluate your equation and repeat if Evaluate your equation and repeat if necessarynecessary

Page 13: Computers on Cruise Control Creating Adaptive Systems with Control Theory Ricardo Portillo The University of Texas at El Paso raportil@miners.utep.edu.

Server ExampleServer Example

1) Determine your system scope: 1) Determine your system scope: - Performance Output = CPU Utilization (range 0-1)- Performance Output = CPU Utilization (range 0-1)- Control Input = Number of Users (NU) (range 0-N)- Control Input = Number of Users (NU) (range 0-N)- CPU(k+1) = a*CPU(k) + b*NU(k)- CPU(k+1) = a*CPU(k) + b*NU(k)

2) Choose your representative workload:2) Choose your representative workload: Some server benchmark (e.g. TPC-C)Some server benchmark (e.g. TPC-C)

3) Run experiments3) Run experiments1) Start up server benchmark1) Start up server benchmark2) Record CPU(k)2) Record CPU(k)3) Change NU(k)3) Change NU(k)4) Goto step 2 until benchmark ends4) Goto step 2 until benchmark ends

Page 14: Computers on Cruise Control Creating Adaptive Systems with Control Theory Ricardo Portillo The University of Texas at El Paso raportil@miners.utep.edu.

Experimental ResultsExperimental Results

After least-squares regression analysis:After least-squares regression analysis:

CPU(k+1) = -0.087*CPU(k)+0.19*NU(k)CPU(k+1) = -0.087*CPU(k)+0.19*NU(k)

kk CPU(k)CPU(k) NU(k)NU(k) CPU(k+1)CPU(k+1)

11 0.620.62 44 0.720.72

22 0.720.72 55 0.760.76

33 0.760.76 55 0.520.52

44 0.520.52 66 0.910.91

55 0.910.91 77 0.920.92

66 0.920.92 88 0.970.97

77 0.970.97 99 1.521.52

88 1.521.52 1010 1.421.42

99 1.421.42 1111 1.991.99

1010 1.991.99 1212 N/AN/A

Page 15: Computers on Cruise Control Creating Adaptive Systems with Control Theory Ricardo Portillo The University of Texas at El Paso raportil@miners.utep.edu.

ControllerController

NU(k) = [0.6 + 0.087*CPU(k)] / 0.19NU(k) = [0.6 + 0.087*CPU(k)] / 0.19

Desired OutputCPU(k+1) -> (e.g. CPU =

0.6)

Control InputNU(k)

Measured OutputCPU(k)

Server

System

Server Feedback LoopServer Feedback Loop

Page 16: Computers on Cruise Control Creating Adaptive Systems with Control Theory Ricardo Portillo The University of Texas at El Paso raportil@miners.utep.edu.

Problem: Difference Equation Problem: Difference Equation may only work for the next may only work for the next

timestep k+1timestep k+1► Assume coefficients a = b = 1Assume coefficients a = b = 1

=>=> y(k+1) = y(k) + u(k)y(k+1) = y(k) + u(k)=> => u(k) = y(k+1) – y(k)u(k) = y(k+1) – y(k)

► Assume at k = 1; y(k) = 1 and you want goal y(k+1) = 2Assume at k = 1; y(k) = 1 and you want goal y(k+1) = 2 u(1)= 2 – 1 = 1 u(1)= 2 – 1 = 1 -> u(1)=1 will produce y(k+1)=2 ->-> u(1)=1 will produce y(k+1)=2 -> Performance goal met at Performance goal met at

k=2k=2

► What’s the value of y(k) at k=3?What’s the value of y(k) at k=3?y(3) = y(2) + u(2) = 2 + 1 = 3 -> y(3) = y(2) + u(2) = 2 + 1 = 3 -> Goal not met at Goal not met at k=3!k=3!

► As k grows ?As k grows ?y(k+1) = y(k) + 1y(k+1) = y(k) + 1

Performance metric will keep increasing until u(k) is Performance metric will keep increasing until u(k) is remodifiedremodified

Page 17: Computers on Cruise Control Creating Adaptive Systems with Control Theory Ricardo Portillo The University of Texas at El Paso raportil@miners.utep.edu.

Example that at least Example that at least convergesconverges

► Assume coefficients a = b = 0.5Assume coefficients a = b = 0.5=>=> y(k+1) = 0.5*y(k) + 0.5*u(k)y(k+1) = 0.5*y(k) + 0.5*u(k)=> => u(k) = [y(k+1) – 0.5*y(k)] / 0.5u(k) = [y(k+1) – 0.5*y(k)] / 0.5

► Assume k = 1; y(k) = 1 and you want goal y(k+1) = 2Assume k = 1; y(k) = 1 and you want goal y(k+1) = 2 u(1) = [2 – .5*1]/.5 = 3 u(1) = [2 – .5*1]/.5 = 3

-> u(1) = 3 will produce y(k+1) = 2 -> Performance goal met at -> u(1) = 3 will produce y(k+1) = 2 -> Performance goal met at k=2k=2

► What’s the value of y(k) at k=3?What’s the value of y(k) at k=3?y(3) = .5*y(2) + .5*u(2) = .5*2 + .5*3 = y(3) = .5*y(2) + .5*u(2) = .5*2 + .5*3 = 2.5 Goal not met 2.5 Goal not met

at k=3!at k=3!► But… as k grows ?But… as k grows ?

y(k+1) = {2.75, 2.87, 2.93, 2.96, 2.98,…}y(k+1) = {2.75, 2.87, 2.93, 2.96, 2.98,…}Performance metric Performance metric convergesconverges to to 3 3 if left unchecked if left unchecked

► A system is A system is stablestable if performance converges when control if performance converges when control input changesinput changes

► A system is A system is accurateaccurate if it converges to the right performance if it converges to the right performance valuevalue

Page 18: Computers on Cruise Control Creating Adaptive Systems with Control Theory Ricardo Portillo The University of Texas at El Paso raportil@miners.utep.edu.

Criteria for a Good ControllerCriteria for a Good Controller

►StabilityStability: Measured performance must : Measured performance must converge to some value when control converge to some value when control inputs are modifiedinputs are modified

►Accuracy: Accuracy: Measured performance Measured performance must converge to the performance goal must converge to the performance goal when control inputs are modifiedwhen control inputs are modified

►Short Settling: Short Settling: Measured Measured performance must converge to the performance must converge to the performance goal quickly when control performance goal quickly when control inputs are modifiedinputs are modified

Page 19: Computers on Cruise Control Creating Adaptive Systems with Control Theory Ricardo Portillo The University of Texas at El Paso raportil@miners.utep.edu.

How can We Evaluate the How can We Evaluate the Criteria?Criteria?

►Convert your difference equation into Convert your difference equation into a non-recursive function by applying a a non-recursive function by applying a Z-transformZ-transform

►Apply Control Theory theorems to your Apply Control Theory theorems to your non-recursive function to assess:non-recursive function to assess: If your equation always converges If your equation always converges

((StabilityStability)) To what value will it converge (To what value will it converge (AccuracyAccuracy)) How fast will it converge (How fast will it converge (Settling TimeSettling Time) )

Page 20: Computers on Cruise Control Creating Adaptive Systems with Control Theory Ricardo Portillo The University of Texas at El Paso raportil@miners.utep.edu.

Advanced Control TheoryAdvanced Control Theory

►Gain Scheduling:Gain Scheduling: Allows different Allows different controllers to be swapped at runtime.controllers to be swapped at runtime.

►Self-Tuning Regulators:Self-Tuning Regulators: Enables the Enables the creation of difference equations at runtime creation of difference equations at runtime using recursive least-squares analysis.using recursive least-squares analysis.

►Fuzzy Controllers:Fuzzy Controllers: Applies heuristics Applies heuristics written in symbolic logic when modifying written in symbolic logic when modifying control inputs. Used when system control inputs. Used when system characterization is qualitative instead of characterization is qualitative instead of quantitative.quantitative.

Page 21: Computers on Cruise Control Creating Adaptive Systems with Control Theory Ricardo Portillo The University of Texas at El Paso raportil@miners.utep.edu.

Control Theory in PracticeControl Theory in Practice

► Data Networks:Data Networks: Much work in data flow Much work in data flow control for TCP protocolscontrol for TCP protocols

► Multimedia:Multimedia: Work on maintaining real-time Work on maintaining real-time performance constraints on data streamsperformance constraints on data streams

► Server and DB Software:Server and DB Software: Most popular Most popular application of CT recently. DB2 contains CT application of CT recently. DB2 contains CT based performance tuningbased performance tuning

► Autonomic Computing Initiative:Autonomic Computing Initiative: Applies Applies holistic CT approach to large systems. holistic CT approach to large systems. Started in 2001 by IBM. Started in 2001 by IBM.

Page 22: Computers on Cruise Control Creating Adaptive Systems with Control Theory Ricardo Portillo The University of Texas at El Paso raportil@miners.utep.edu.

Future of CT in ComputingFuture of CT in Computing

►Apply CT not only for regulatory Apply CT not only for regulatory performance control but also to performance control but also to performance optimization (e.g. with performance optimization (e.g. with Fuzzy controllers)Fuzzy controllers)

►Automate the design of controllers (e.g. Automate the design of controllers (e.g. with Self-tuning regulators)with Self-tuning regulators)

► Incorporate artificial intelligence to Incorporate artificial intelligence to create and manage adaptive systems create and manage adaptive systems at runtime (e.g. with agent based at runtime (e.g. with agent based computing)computing)

Page 23: Computers on Cruise Control Creating Adaptive Systems with Control Theory Ricardo Portillo The University of Texas at El Paso raportil@miners.utep.edu.

In SummaryIn Summary

►Systems are becoming too complex to Systems are becoming too complex to manage without automationmanage without automation

►Control Theory provides a systematic Control Theory provides a systematic method of integrating adaptation into method of integrating adaptation into a systema system

►Control Theory is well established and Control Theory is well established and easily maps to computing easily maps to computing environmentsenvironments


Recommended