COMP28112 – Lecture 16 The quest for performance (lab exercise 3)

Slides:



Advertisements
Similar presentations
Lab Assignment 1 COP 4600: Operating Systems Principles Dr. Sumi Helal Professor Computer & Information Science & Engineering Department University of.
Advertisements

Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 19 Scheduling IV.
OS Fall ’ 02 Performance Evaluation Operating Systems Fall 2002.
Performance Evaluation
© 2004 by Prentice Hall, Inc., Upper Saddle River, N.J F-1 Operations Management Simulation Module F.
Simulating Single server queuing models. Consider the following sequence of activities that each customer undergoes: 1.Customer arrives 2.Customer waits.
Chapter 14 Simulation. Monte Carlo Process Statistical Analysis of Simulation Results Verification of the Simulation Model Computer Simulation with Excel.
Project 2: ATM’s & Queues
12-Jul-15COMP28112 Lecture 141 COMP28112 – Lecture 14 The Quest for Performance (lab exercise 3)
Monté Carlo Simulation MGS 3100 – Chapter 9. Simulation Defined A computer-based model used to run experiments on a real system.  Typically done on a.
Slide - 1 Dr Terry Hinton 6/9/05UniS - Based on Slides by Micro Analysis & Design An example of a Simulation Simulation of a bank: Three tasks or processes:
Introduction to Discrete Event Simulation Customer population Service system Served customers Waiting line Priority rule Service facilities Figure C.1.
(C) 2009 J. M. Garrido1 Object Oriented Simulation with Java.
AN INTRODUCTION TO THE OPERATIONAL ANALYSIS OF QUEUING NETWORK MODELS Peter J. Denning, Jeffrey P. Buzen, The Operational Analysis of Queueing Network.
Simulation Examples ~ By Hand ~ Using Excel
1 Performance Evaluation of Computer Networks: Part II Objectives r Simulation Modeling r Classification of Simulation Modeling r Discrete-Event Simulation.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
Project 2: ATM’s & Queues. ATM’s & Queues  Certain business situations require customers to wait in line for a service Examples:  Waiting to use an.
NETE4631:Capacity Planning (2)- Lecture 10 Suronapee Phoomvuthisarn, Ph.D. /
Chapter 3 System Performance and Models. 2 Systems and Models The concept of modeling in the study of the dynamic behavior of simple system is be able.
Structure of a Waiting Line System Queuing theory is the study of waiting lines Four characteristics of a queuing system: –The manner in which customers.
Entities and Objects The major components in a model are entities, entity types are implemented as Java classes The active entities have a life of their.
Lecture 19 Nov10, 2010 Discrete event simulation (Ross) discrete and continuous distributions computationally generating random variable following various.
Chapter 2 Fundamental Simulation Concepts
1 1 Slide © 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole.
NETE4631: Network Information System Capacity Planning (2) Suronapee Phoomvuthisarn, Ph.D. /
1 1 Slide © 2009 South-Western, a part of Cengage Learning Slides by John Loucks St. Edward’s University.
OPERATING SYSTEMS CS 3530 Summer 2014 Systems and Models Chapter 03.
(C) J. M. Garrido1 Objects in a Simulation Model There are several objects in a simulation model The activate objects are instances of the classes that.
1 1 Slide Chapter 12 Waiting Line Models n The Structure of a Waiting Line System n Queuing Systems n Queuing System Input Characteristics n Queuing System.
 Simulation enables the study of complex system.  Simulation is a good approach when analytic study of a system is not possible or very complex.  Informational,
Modeling the Optimization of a Toll Booth Plaza By Liam Connell, Erin Hoover and Zach Schutzman Figure 1. Plot of k values and outputs from Erlang’s Formula.
T Confidence Intervals and Tests Weights of Football Players.
Introduction to Simulation Chapter 12. Introduction to Simulation  In many spreadsheets, the value for one or more cells representing independent variables.
CPSC 531: System Modeling and Simulation
Auburn University
Computer Simulation Henry C. Co Technology and Operations Management,
A few words about parallel computing
OPERATING SYSTEMS CS 3502 Fall 2017
Chapter 16: Sample Size “See what kind of love the Father has given to us, that we should be called children of God; and so we are. The reason why the.
COMP28112 – Lecture 16 The Quest for Performance (lab exercise 3)
Random variables (r.v.) Random variable
Prepared by Lloyd R. Jaisingh
Auburn University COMP7330/7336 Advanced Parallel and Distributed Computing Data Partition Dr. Xiao Qin Auburn University.
ADVANTAGES OF SIMULATION
2.7: Simulation.
Queuing Theory Jackson Networks
Introduction to Extend
Modeling and Simulation CS 313
The relational operators
Some problems and more…
COMP28112 – Lecture 18 The quest for performance (lab exercise 3)
DECISION MODELING WITH Prentice Hall Publishers and
COMP60611 Fundamentals of Parallel and Distributed Systems
COMP60621 Designing for Parallelism
Architectures of distributed systems Fundamental Models
Lab Exercise 2 (Lab Sessions 2, 3, and 4)
Data types, assignment statements, and math functions allow you to compute You write a sequence of statements that tell the computer what needs to be done.
Architectures of distributed systems Fundamental Models
COMP28112 Distributed Computing
COMP28112 Lecture 2 A few words about parallel computing
COMP28112 Distributed Computing
Lecture 2 Part 3 CPU Scheduling
A few words about parallel computing
COMP60621 Designing for Parallelism
A few words about parallel computing
Architectures of distributed systems Fundamental Models
RANDOM VARIABLES Random variable:
MECH 3550 : Simulation & Visualization
COMP28112 – Lecture 15 The quest for performance (lab exercise 3)
Presentation transcript:

COMP28112 – Lecture 16 The quest for performance (lab exercise 3) 6-Dec-18 COMP28112 Lecture 16

Performance Issues It’s not a good idea to build a distributed system and then realise that it fails to meet demand! Trial and error is not a good idea! One issue with distributed systems is that some of the solutions trade performance for something else: for example, XML might be good for interoperability, however, it increases the size of communication messages! Performance Modelling: A model is a representation of a system that captures the most relevant characteristics of the system under study. The model is used to analyse the behaviour of a system under different circumstances 6-Dec-18 COMP28112 Lecture 16

What is a performance model? Why? An abstraction of the reality that allows us to study the performance-related characteristics of the system. The model is not the reality: this introduces some errors! How many servers to cope with demand? For a specific type of workload, what is the most effective scheme for load balancing? Performance tuning is a huge territory. What are the sources of performance problems? (bottlenecks) Performance models are used to answer what-if questions as opposed to direct changes in the production environment! 6-Dec-18 COMP28112 Lecture 16

Performance Modelling Approaches Two key approaches: Analytical solution: Derive formulas: Some times this is simple, but most of the times it is not! There is a branch of mathematics dealing with the properties of systems with queues: it requires more advanced Maths than the Maths we teach here (unfortunately ) Queuing theory (http://en.wikipedia.org/wiki/Queueing_theory) could have helped with lab exercise 3! Simulation: Monte-Carlo Simulations (random numbers are used) Discrete-Event Simulation (& events over time are considered) 6-Dec-18 COMP28112 Lecture 16

Analytical Models: examples Remember Amdahl’s law from Lecture 2? This is a basic model to estimate the running time, tp, of a programme running on p CPUs, which when running on one machine runs in time ts: tp=to+ts*(1-x+x/p) Minimum Possible http transaction time: t = RTT + trequest + tsiteprocessing + treply, where RTT is round-trip-time, trequest is requestsize/bandwidth, tsiteprocessing is the time for processing and treply is replysize/bandwidth. (Heidemann et al, Transactions on Networking,1998) 6-Dec-18 COMP28112 Lecture 16

Some problems are simple We have 1000 transactions to process. We have 3 servers: Atlas can process 12 transactions per second Bamboo can process 29 transactions per second Caesar can process 59 transactions per second How shall we allocate the transactions for load balancing? What if each transaction takes a different amount of time? 6-Dec-18 COMP28112 Lecture 16

Queueing Theory Based on applied probability theory It studies the behaviour of systems with service counters to which customers arrive and join a waiting line (queue). Parameters of the problem: Arrival rate Number of servers Processing time … Key question: what is the average waiting time? Interested in steady-state solutions. System 6-Dec-18 COMP28112 Lecture 16

A useful result: Little’s Law In the steady-state: Avg_no_of_customers_in =arrival_rate × service_time A web server was monitored for 30 minutes and the number of requests submitted was found to be 9000. The average number of active requests in the system was 7. What was the average service time for each request? In the Duchy of Grand Fenwick, every year, 100 trainee dentists pass their qualification exam and start practicing the profession. If a dentist works for 20 years on average, how many dentists will be working in the Duchy in 2050? 6-Dec-18 COMP28112 Lecture 16

Simulation Monte-Carlo methods: Calculate results based on repeated random sampling. Generate random input Simulate what follows and check the result Useful for computing a result after a large number of samples. Example: verify the winning strategy in the Monty Hall problem. 6-Dec-18 COMP28112 Lecture 16

Discrete Event Simulation Events are randomly generated. The simulation proceeds as a chronological sequence of events. Implies some notion of time in the simulation Many computer games are discrete event simulations: e.g., football manager 6-Dec-18 COMP28112 Lecture 16

An example of discrete event simulation // football manager, main loop Time=0; Set_initial_conditions; Do { time++; retrieve_events_for_time; //eg, game against X process_event_for_time; //eg, pick team, play game update_data; //eg, update league table generate_new_events; // player injured until time t } while simulation_is_on; 6-Dec-18 COMP28112 Lecture 16

Lab exercise 3 In this system, requests keep arriving from the clients; these requests involve some computation at the server (we don’t care what is computed). The average time between the arrival of two successive requests is an input parameter (expressed in time units, which is the unit of time used in the simulation – see below). When these requests arrive, they are initially stored in a queue. The maximum queue size is an input parameter. Any requests that arrive when the queue is full are rejected. A number of servers (or CPUs, if you like) may fetch requests from the queue for execution. Only one server can fetch requests at a time. Clearly, a single server cannot execute multiple requests at the same time. The time needed by the server to complete every request is also an input parameter (expressed again in time units). Taking as an input the four parameters described above, you are going to write a program to simulate the system and show, over a period of 1,000,000 time units: The percentage of requests that was rejected. The average queue size (that is, how many requests were in the queue on average) during the simulated period of time. The average response time of the system to each request that was processed during this period of time (the response time is computed as the difference between the time the request has completed its execution on one of the servers and the time the request arrived to the queue). 6-Dec-18 COMP28112 Lecture 16

Skeleton Do { time++; run_events_for_time; //eg, new request update_state_of_system; update_statistics_you_need; } while simulation_time_less_than_1000000 6-Dec-18 COMP28112 Lecture 16

Arrival Rates A huge computer cluster has, on average, 48 faults per day. 36 faults occurred in the first 6 hours of a certain day. How many faults are expected in the next 18 hours? (To go back to Little’s law, if every fault needs 30 minutes to repair, how many faults does the system have at any point in time?) You don’t need to know about Little’s law for lab exercise 3! All you need to do is to simulate the requests that arrive according to the arrival rate. 6-Dec-18 COMP28112 Lecture 16

This is an one session lab! Random Numbers Every modern language has some library to generate random numbers (for example, in java, check java.util.Random; in C check rand(); etc…) You’ll need to use some function to generate Random Numbers in a certain range You don’t need to know this for the lab exercise, but these numbers are not truly random; they are pseudo-random numbers generated by carefully chosen mathematical formulae. If the initial condition is the same, the same numbers are generated! (e.g., RND=(8*RND+9)mod 10: 0,9,1,7,5,9 - there is a period, after which numbers are repeated) This is an one session lab! 6-Dec-18 COMP28112 Lecture 16