Software Performance Engineering - SPE HW - Answers Steve Chenoweth CSSE 375, Rose-Hulman Tues, Oct 23, 2007.

Slides:



Advertisements
Similar presentations
Chapter 9. Performance Management Enterprise wide endeavor Research and ascertain all performance problems – not just DBMS Five factors influence DB performance.
Advertisements

Chapter 4 Memory Management Page Replacement 补充:什么叫页面抖动?
Running MSOPIT for Assignment #6 These Slides are Base on MS3D version 4.6 which was current in Sept. of 2009 Note – These slides contain concepts also.
1 Transportation Model. 2 Basic Problem The basic idea in a transportation problem is that there are sites or sources of product that need to be shipped.
101.  Computers DO NOT think for themselves. For them to do anything they need to be told what to do.  Simply put computer programming is when you tell.
1/1/ / faculty of Electrical Engineering eindhoven university of technology Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir.
Digital Logic Design Lecture # 17 University of Tehran.
The 8085 Microprocessor Architecture
G. Alonso, D. Kossmann Systems Group
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 3: Input/output and co-processors dr.ir. A.C. Verschueren.
Copyright , Dennis J. Frailey CSE7315 – Software Project Management CSE7315 M30 - Version 9.01 SMU CSE 7315 Planning and Managing a Software Project.
Disk Access Model. Using Secondary Storage Effectively In most studies of algorithms, one assumes the “RAM model”: –Data is in main memory, –Access to.
Chapter 22 Simulation with Process Model to accompany Operations Research: Applications and Algorithms 4th edition by Wayne L. Winston Copyright (c) 2004.
1 CSSE 377 – Intro to Availability & Reliability Part 2 Steve Chenoweth Tuesday, 9/13/11 Week 2, Day 2 Right – Pictorial view of how to achieve high availability.
1 CSSE 477 – A bit more on Performance Steve Chenoweth Friday, 9/9/11 Week 1, Day 2 Right – Googling for “Performance” gets you everything from Lady Gaga.
Software Performance Engineering Steve Chenoweth CSSE 375, Rose-Hulman Tues, Oct 23, 2007.
FALL 2006CENG 351 Data Management and File Structures1 External Sorting.
1 Course Intro Construction & Evolution CSSE 375 Steve Chenoweth.
Prototyping. CS351 - Software Engineering (AY2004)2 Scenario Customer: “We would like the word processor to check the spelling of what is typed in. We.
Tirgul 6 B-Trees – Another kind of balanced trees Problem set 1 - some solutions.
Example 9.1 Goal Programming | 9.3 | Background Information n The Leon Burnit Ad Agency is trying to determine a TV advertising schedule.
INFO 638Lecture #41 Software Project Management Resource availability and critical chain INFO 638 Glenn Booker.
Sequential circuit design
Analysis of Simulation Results Andy Wang CIS Computer Systems Performance Analysis.
Scalability By Alex Huang. Current Status 10k resources managed per management server node Scales out horizontally (must disable stats collector) Real.
Functions 1 parameter, 2 return-values "Conversion of time format" One problem. 5 steps to solve it. 1.
BIT 286: Web Applications Work Breakdown Structure (WBS); Scheduling.
Offline Performance Monitoring for Linux Abhishek Shukla.
1 COMPSCI 110 Operating Systems Who - Introductions How - Policies and Administrative Details Why - Objectives and Expectations What - Our Topic: Operating.
Project Management : Techniques and Tools (60-499) Fall 2014 / Winter 2015.
Stat 13, Thu 5/10/ CLT again. 2. CIs. 3. Interpretation of a CI. 4. Examples. 5. Margin of error and sample size. 6. CIs using the t table. 7. When.
Project Tracking. Questions... Why should we track a project that is underway? What aspects of a project need tracking?
August 01, 2008 Performance Modeling John Meisenbacher, MasterCard Worldwide.
The Functions of Operating Systems Interrupts. Learning Objectives Explain how interrupts are used to obtain processor time. Explain how processing of.
Rui Ribeiro MCITP 2010/10/19 Index optimization … …on low peak periods V ENCONTRO DA COMUNIDADE SQLPORT.
1 Psych 5500/6500 Standard Deviations, Standard Scores, and Areas Under the Normal Curve Fall, 2008.
Peg Carlson, PhD NCCCMA Summer Seminar June 19,2015.
By Phani Gowthami Tammineni. Overview This presentation is about the issues in real-time database systems and presents an overview of the state of the.
Software Construction and Evolution - CSSE 375 Code Tuning Shawn and Steve Left – Even tuning an ancient instrument like a violin involves multiple steps.
Grade Book Database Presentation Jeanne Winstead CINS 137.
Lecture 11 Page 1 CS 111 Online Working Sets Give each running process an allocation of page frames matched to its needs How do we know what its needs.
How To Do NPV’s ©2007 Dr. B. C. Paul Note – The principles covered in these slides were developed by people other than the author, but are generally recognized.
AP-1 4. Agile Processes. AP-2 Agile Processes Focus on creating a working system Different attitude on measuring progress XP Scrum.
1 System Clock and Clock Synchronization.. System Clock Background Although modern computers are quite fast and getting faster all the time, they still.
 In this packet we will look at:  The meaning of acceleration  How acceleration is related to velocity and time  2 distinct types acceleration  A.
CSCI1600: Embedded and Real Time Software Lecture 28: Verification I Steven Reiss, Fall 2015.
Week 6. Statistics etc. GRS LX 865 Topics in Linguistics.
Introduction to Microprocessors - chapter3 1 Chapter 3 The 8085 Microprocessor Architecture.
Introduction to Information Retrieval Introduction to Information Retrieval Lecture 4: Index Construction Related to Chapter 4:
BIT 143: Programming – Data Structures It is assumed that you will also be present for the slideshow for the first day of class. Between that slideshow.
CSE SW Project Management / Module 30 - Managing with Earned Value / Measurement Issues Copyright © , Dennis J. Frailey, All Rights Reserved.
Power Guru: Implementing Smart Power Management on the Android Platform Written by Raef Mchaymech.
1 SYS366 Week 1 - Lecture 1 Introduction to Systems.
Sequential Processing to Update a File Please use speaker notes for additional information!
The Year of the Curriculum: Life Without Levels The programme consists of a bridging unit and five further units: © Curriculum Foundation1 Bridging Unit.
If you have a transaction processing system, John Meisenbacher
Development Project Management Jim Kowalkowski. Outline Planning and managing software development – Definitions – Organizing schedule and work (overall.
Reliability of Disk Systems. Reliability So far, we looked at ways to improve the performance of disk systems. Next, we will look at ways to improve the.
The 8085 Microprocessor Architecture
Database Applications (15-415) DBMS Internals- Part VII Lecture 16, October 25, 2016 Mohammad Hammoud.
The 8085 Microprocessor Architecture
Extreme Programming.
Organizations, Constraints & Projects
Please use speaker notes for additional information!
The 8085 Microprocessor Architecture
Please use speaker notes for additional information!
Supporting a Business Process
Supporting a Business Process
Chapter 1: Creating a Program.
Presentation transcript:

Software Performance Engineering - SPE HW - Answers Steve Chenoweth CSSE 375, Rose-Hulman Tues, Oct 23, 2007

SPE HW – Here was the original example: You have a system that monitors economic transactions for Amazon.com. You have a system that monitors economic transactions for Amazon.com. Let’s look at critical use cases / scenarios: Let’s look at critical use cases / scenarios: –It sees 60,000 transactions per hour (peak hour). –Each validated transaction updates status and activity information in the memory of a server. –You have five displays for people watching. They see exception transactions and statistics. –Oh, and exception transactions need to be shown, too. –These screens should automatically update every 10 seconds. –Every 10 minutes the in-memory info is saved to disk, using SQL-Server. On original slide # 6

SPE HW: And our first analysis Design looks something like this figure. Design looks something like this figure. 60,0000 trans/hr = 1000 trans/min = 16.7 trans/sec = 60 ms/trans. 60,0000 trans/hr = 1000 trans/min = 16.7 trans/sec = 60 ms/trans. Naïvely assume each of the 3 functions on a trans takes equal time. Naïvely assume each of the 3 functions on a trans takes equal time. So, they each have to be done in 20 ms. So, they each have to be done in 20 ms. But there are also two performance “lumps” – But there are also two performance “lumps” – –Updating the 5 displays every 10 sec, and –Writing the memory data to disk every 10 min! Trans validate Find exceptions Update displays Put in DB Update stats Trans Input Stream 60k/hr 20 ms? Every 10 sec Every 10 min On original slide # 7

But we hadn’t yet considered the “lumps” of activity to produce output: Can you assume that these “lumps” can be tuned out of the system during testing? Can you assume that these “lumps” can be tuned out of the system during testing? –Why or why not? Trans validate Find exceptions Update displays Put in DB Update stats Trans Input Stream 60k/hr 20 ms? Every 10 sec Every 10 min On original slide # 8

When we did – this was a better answer: Not unless you’re used to dealing with such things already! Not unless you’re used to dealing with such things already! If not, better budget for them, too: If not, better budget for them, too: –Divide the 60 ms/trans by 5, not by 3. –Each of the 3 oringinal functions shown gets 12 ms/trans. –Display refresh gets 1/5 of every CPU second, or 200 ms. So 5 displays refreshed every 10 sec = 1 every 2 sec. Each display refresh gets a 400 ms budget. –DB write gets 1/5 of every CPU second, or 200 ms, also. Over 10 min, it then gets 200 * 60 * 10 ms = 2 min of CPU time. But, this had better be distributed evenly! Trans validate Find exceptions Update displays Put in DB Update stats Trans Input Stream 60k/hr 12 ms 200 ms 2 min On original slide # 9

But…we then added this info: This is still optimistic! This is still optimistic! It assumes you have all the CPU time for your application, and It assumes you have all the CPU time for your application, and It assumes your transactions aren’t “lumpy,” and It assumes your transactions aren’t “lumpy,” and That the system won’t grow. That the system won’t grow. A more conservative start would be to cut all the targets in half, on the previous page. A more conservative start would be to cut all the targets in half, on the previous page. On original slide # 10

Result was: Budgets for each programmer, during construction I’m doing the input validation feature. I’m doing the input validation feature. I know from day 1 that it has to run in a budget of 50% * 12 ms = 6 ms on each transaction. I know from day 1 that it has to run in a budget of 50% * 12 ms = 6 ms on each transaction. I can design to that. I can design to that. I can test that, at least tentatively, even in unit testing! This will give me estimates to see if I’m “close.” I can test that, at least tentatively, even in unit testing! This will give me estimates to see if I’m “close.” To do that, I need to “instrument” my code. How? To do that, I need to “instrument” my code. How? Real results feed back to the person in charge of the performance spreadsheet. Real results feed back to the person in charge of the performance spreadsheet. –Their spreadsheet shows if we still meet the requirements targets. –They are also involved in system test, where we get the real results. We have an informed engineering guess, at all times, about “whether we can make it” on performance. We have an informed engineering guess, at all times, about “whether we can make it” on performance. On original slide # 11

We mentioned estimating use of other shared resources We looked at CPU time. We looked at CPU time. Other things often budgeted and tracked thru development include “whatever may be of concern,” like: Other things often budgeted and tracked thru development include “whatever may be of concern,” like: –Memory space –Disk I/O time –Communications time On original slide # 12

And the whole process… Real risk determines how much time to spend on getting performance (or any other quality attribute) right. Real risk determines how much time to spend on getting performance (or any other quality attribute) right. Need to focus on critical use cases / scenarios. Need to focus on critical use cases / scenarios. Discover competing needs for resources like CPU time. Discover competing needs for resources like CPU time. Make initial guesses about how to divide these, cycle back and improve on those guesses. Make initial guesses about how to divide these, cycle back and improve on those guesses. Start simply. Start simply. At some point in refinement, however, you have to start considering queuing effects in a more sophisticated way, to be more accurate. At some point in refinement, however, you have to start considering queuing effects in a more sophisticated way, to be more accurate. Someone needs to be in charge of the spreadsheet, and of making performance “happen.” Someone needs to be in charge of the spreadsheet, and of making performance “happen.” Getting good numbers to start with is a “fall out” advantage of this process. Getting good numbers to start with is a “fall out” advantage of this process. Most performance successes are due to good design. Most performance successes are due to good design. On original slide # 13

Here was the HW assignment – Take the architecture we already used as an example. Take the architecture we already used as an example. Now assume that we get the following feedback from the designers of each of the subsystems shown: Now assume that we get the following feedback from the designers of each of the subsystems shown: –The “Trans validate” code is now estimated as only half as complex as the code in the “Update stats” and “Find exceptions” routines. (Time complexity, that is.) –Saving all the statistics to the DB must be one “synchronized” action every 10 min. This is now estimated to take 5 sec. The remaining DB tasks, however, can be distributed evenly over each 10 min interval. Reallocate the budgets accordingly, assuming we want to be “conservative” and only use 50% of available CPU time! Reallocate the budgets accordingly, assuming we want to be “conservative” and only use 50% of available CPU time! Make clear any guesses or assumptions you made. Make clear any guesses or assumptions you made. Turn this in as the “Software Performance HW” assignment, by 11:55 PM, Wed, Oct 24. Turn this in as the “Software Performance HW” assignment, by 11:55 PM, Wed, Oct 24. On original slide # 15

So, how to proceed on the HW? You are really given three things to solve here: 1. Being “conservative,” and reallocating what we had, to use only 50% of the whole CPU time. 2. How to handle the fact that “Trans validate” code is now estimated as only half as complex as the code in the “Update stats” and “Find exceptions” routines. And, 3. Saving all the statistics to the DB must be one “synchronized” action every 10 min. This is now estimated to take 5 sec. The remaining DB tasks, however, can be distributed evenly over each 10 min interval.

Let’s do the “conservative” one: 1. Being “conservative,” and reallocating what we had, to use only 50% of the whole CPU time, we get half of each figure from “slide 9”: Trans validate Find exceptions Update displays Put in DB Update stats Trans Input Stream 60k/hr 6 ms (1) 100 ms (2) 1 min (3) (1)Per transaction. (2)Per second, for all 5 displays. (3)Every 10 min, for the DB.

Reallocating the transaction budget times: 2. How to handle the fact that “Trans validate” code is now estimated as only half as complex as the code in the “Update stats” and “Find exceptions” routines: You could have made different assumptions here. Let’s assume you only needed to reallocate the budgets for the 3 routines handling the transactions. We had: 6 ms + 6 ms + 6 ms = 18 ms total. But we now want: x ms + 2*x ms + 2*x ms = 18 ms, where x = Trans validate’s budget. So, 5 * x = 18, and x = 3.6 ms. The other two transaction-related routines each get a new budget of 7.2 ms (instead of 6 ms).

And the whole thing now looks like this: (Again, we assumed only the transaction-handling budgets were affected here.) (Again, we assumed only the transaction-handling budgets were affected here.) Trans validate Find exceptions Update displays Put in DB Update stats Trans Input Stream 60k/hr 3.6 ms (1) 7.2 ms (1) 100 ms (2) 1 min (3) (1)Per transaction. (2)Per second, for all 5 displays. (3)Every 10 min, for the DB.

Now, what about the DB part? 3. Saving all the statistics to the DB must be one “synchronized” action every 10 min. This is now estimated to take 5 sec. The remaining DB tasks, however, can be distributed evenly over each 10 min interval. This asks us to handle a “lumpy distribution problem.” Let’s assume that the DB statistics action is “synchronized” by locking the table it is writing to the DB. Let’s also figure we still get 1 CPU minute every 10 minutes for all the DB saving activities, so leaves a 60 – 5 = 55 sec budget for the non-stat DB actions. If we get half the CPU time overall for our application, the DB stat action thus “locks out” the other parts of our application for 2*5 = 10 clock seconds in a row, and this happens every 10 minutes. (Or, at least the parts of our app which update the DB from each transaction.)

So, what you need to do is… Show two pictures of the budgets – Show two pictures of the budgets – –How they look when this synchronized DB stats update is happening, and –How they look when it isn’t happening. That handles the lumpiness. That handles the lumpiness.

Here’s one solution… a. During the 10 sec of time the DB stats update goes on: Trans validate Find exceptions Update displays Put stats In DB Update stats Trans Input Stream 60k/hr (4) 0 ms (1) 0 ms (2) 5 sec (3) (1)Per transaction. (2)Per second, for all 5 displays. (3)Every 10 min, for the DB. (4)Assume that transactions simply back up in buffers!

And… b. During the rest of the time: Trans validate Find exceptions Update displays Put other In DB Update stats Trans Input Stream 60k/hr 3.6 ms (1) 7.2 ms (1) 100 ms (2) 55 sec (3) (1)Per transaction. (2)Per second, for all 5 displays. (3)Every 10 min, for the DB.

So, what was a “good answer” to the HW? The last 2 figures! The last 2 figures! And the assumptions we made to get them. And the assumptions we made to get them. This accounts for all the required new knowledge (1, 2, and 3) in the HW. This accounts for all the required new knowledge (1, 2, and 3) in the HW.