12-Jul-15COMP28112 Lecture 141 COMP28112 – Lecture 14 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

(Monté Carlo) Simulation
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 19 Scheduling IV.
All Hands Meeting, 2006 Title: Grid Workflow Scheduling in WOSE (Workflow Optimisation Services for e- Science Applications) Authors: Yash Patel, Andrew.
Event-drive SimulationCS-2303, C-Term Project #3 – Event-driven Simulation CS-2303 System Programming Concepts (Slides include materials from The.
Nur Aini Masruroh Queuing Theory. Outlines IntroductionBirth-death processSingle server modelMulti server model.
1 Part II Web Performance Modeling: basic concepts © 1998 Menascé & Almeida. All Rights Reserved.
CS CS 5150 Software Engineering Lecture 19 Performance.
HW # Due Day: Nov 23.
Discrete Event Simulation How to generate RV according to a specified distribution? geometric Poisson etc. Example of a DEVS: repair problem.
Components and Organization of Discrete-event Simulation Model
© 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.
Project 2: ATM’s & Queues
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:
CDA6530: Performance Models of Computers and Networks Examples of Stochastic Process, Markov Chain, M/M/* Queue TexPoint fonts used in EMF. Read the TexPoint.
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.
Chapter 8 Architecture Analysis. 8 – Architecture Analysis 8.1 Analysis Techniques 8.2 Quantitative Analysis  Performance Views  Performance.
Modeling and Performance Evaluation of Network and Computer Systems Introduction (Chapters 1 and 2) 10/4/2015H.Malekinezhad1.
Chapter 11 – Understanding Randomness 1. What is a random event? Nobody can guess the outcome before it happens. Let’s try an experiment. On the next page.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
Performance Model & Tools Summary Hung-Hsun Su UPC Group, HCS lab 2/5/2004.
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.
Data Structures Using C++ 2E Chapter 8 Queues. Data Structures Using C++ 2E2 Objectives Learn about queues Examine various queue operations Learn how.
Example simulation execution The Able Bakers Carhops Problem There are situation where there are more than one service channel. Consider a drive-in restaurant.
Lecture 19 Nov10, 2010 Discrete event simulation (Ross) discrete and continuous distributions computationally generating random variable following various.
R Introduction and Training Patrick Gurian, Drexel University CAMRA 1st QMRA Summer Institute August 7, 2006.
1.3 Simulations and Experimental Probability (Textbook Section 4.1)
Chapter 5 Parameter estimation. What is sample inference? Distinguish between managerial & financial accounting. Understand how managers can use accounting.
Chapter 2 Fundamental Simulation Concepts
1 CMPSCI 187 Computer Science 187 Introduction to Introduction to Programming with Data Structures Lecture 13: Queues Announcements.
Computer Simulation. The Essence of Computer Simulation A stochastic system is a system that evolves over time according to one or more probability distributions.
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.
Ó 1998 Menascé & Almeida. All Rights Reserved.1 Part VI System-level Performance Models for the Web (Book, Chapter 8)
Internet Applications: Performance Metrics and performance-related concepts E0397 – Lecture 2 10/8/2010.
(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.
Waiting Line Theory Akhid Yulianto, SE, MSc (log).
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.
Example 14.3 Queuing | 14.2 | 14.4 | 14.5 | 14.6 | 14.7 |14.8 | Background Information n County Bank has several.
 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 AND SIMULATION CS 313 Simulation Examples 1.
Simulation. Types of simulation Discrete-event simulation – Used for modeling of a system as it evolves over time by a representation in which the state.
1 BIS 3106: Business Process Management (BPM) Lecture Nine: Quantitative Process Analysis (2) Makerere University School of Computing and Informatics Technology.
Copyright © 2009 Pearson Education, Inc. Chapter 11 Understanding Randomness.
Simulation of single server queuing systems
A few words about parallel computing
OPERATING SYSTEMS CS 3502 Fall 2017
COMP28112 – Lecture 16 The Quest for Performance (lab exercise 3)
Introduction to Extend
COMP28112 – Lecture 18 The quest for performance (lab exercise 3)
COMP28112 – Lecture 16 The quest for performance (lab exercise 3)
COMP60611 Fundamentals of Parallel and Distributed Systems
COMP28112 Distributed Computing
COMP28112 Distributed Computing
A few words about parallel computing
COMP60621 Designing for Parallelism
A few words about parallel computing
COMP28112 – Lecture 15 The quest for performance (lab exercise 3)
Presentation transcript:

12-Jul-15COMP28112 Lecture 141 COMP28112 – Lecture 14 The Quest for Performance (lab exercise 3)

12-Jul-15COMP28112 Lecture 142 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

12-Jul-15COMP28112 Lecture 143 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!

12-Jul-15COMP28112 Lecture 144 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 ( could have helped with lab exercise 3! –Simulation: Monte-Carlo Simulations (random numbers are used) Discrete-Event Simulation (& events over time are considered)

12-Jul-15COMP28112 Lecture 145 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 + t request + t siteprocessing + t reply, where RTT is round-trip-time, t request is requestsize/bandwidth, t siteprocessing is the time for processing and t reply is replysize/bandwidth. (Heidemann et al, Transactions on Networking,1998)

12-Jul-15COMP28112 Lecture 146 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?

12-Jul-15COMP28112 Lecture 147 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

12-Jul-15COMP28112 Lecture 148 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 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?

12-Jul-15COMP28112 Lecture 149 Simulation Monte-Carlo methods: –Calculate results based on repeated random sampling. 1.Generate random input 2.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.

12-Jul-15COMP28112 Lecture 1410 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

12-Jul-15COMP28112 Lecture 1411 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;

12-Jul-15COMP28112 Lecture 1412 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).

12-Jul-15COMP28112 Lecture 1413 Skeleton Do { time++; run_events_for_time; //eg, new request update_state_of_system; update_statistics_you_need; } while simulation_time_less_than_

12-Jul-15COMP28112 Lecture 1414 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.

12-Jul-15COMP28112 Lecture 1415 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 within 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!