Presentation is loading. Please wait.

Presentation is loading. Please wait.

Understanding Networked Applications: A First Course Chapter 17 by David G. Messerschmitt.

Similar presentations


Presentation on theme: "Understanding Networked Applications: A First Course Chapter 17 by David G. Messerschmitt."— Presentation transcript:

1 Understanding Networked Applications: A First Course Chapter 17 by David G. Messerschmitt

2 Understanding Networked Applications A First Course 2 Summary Performance and quality Concurrency Scalability Operating systems

3 Understanding Networked Applications A First Course 3 What is performance Characterizing non-functional application attributes Quantitative metrics –Latency, speed, etc –Parameterized by load, users, etc Performance of application as a whole usually not meaningful –Subdivide into tasks

4 Understanding Networked Applications A First Course 4 Tasks Collection of actions that are not meaningfully separated –Only completed task is of interest; partial results not useful –How does this relate to atomicity in transactions? For repetitive tasks, users or operators often care about –Task completion time (sec) –Task throughput (tasks/sec)

5 Understanding Networked Applications A First Course 5 Important questions For any application What are the tasks? –Which is important: completion time, throughput, or both, or something else? –What are the quantitative objectives?

6 Understanding Networked Applications A First Course 6 Example: Web surfing Task: –User: Click on URL, retrieve page, display –Server: HTTP request received, HTML page formed as a message, message transmitted What performance metric(s) are important to: –User? –Server?

7 Understanding Networked Applications A First Course 7 Examples What are the tasks and their appropriate performance metrics for the following applications: –Schwab stock trading system? –Stock ticker? –ATM system? –Travel reservation system? –Remote conferencing?

8 Understanding Networked Applications A First Course 8 Typical components of task completion time ClientServer Formulate request Message latency Processing time to formulate response Interpret response

9 Understanding Networked Applications A First Course 9 Time Large completion time and high throughput Small completion time and low throughput Concurrency Completion time and throughput are unrelated

10 Understanding Networked Applications A First Course 10 Concurrency Two tasks are concurrent if they overlap in time Four cases: Time

11 Understanding Networked Applications A First Course 11 Concurrency may be…. …a way to satisfy intrinsic application requrements –e.g. a number of users may generate concurrent tasks …a way to improve fairness …a way to increase task throughput –e.g. assign tasks to different hosts to get more done …a way to reduce task completion time –e.g. divide a task into subtasks and assign those subtasks to different hosts

12 Understanding Networked Applications A First Course 12 Time Tasks not concurrent Scheduling delay Tasks concurrent Short task completes sooner Concurrency for fairness

13 Understanding Networked Applications A First Course 13 Time Tasks not concurrent Scheduling delay Tasks concurrent Even though each task takes longer, short task still completes sooner Concurrency may contribute to fairness on a single host

14 Understanding Networked Applications A First Course 14 User view Reality Time slice Context switch Concurrency on a single host Why do this? What is effect on completion time of each task?

15 Understanding Networked Applications A First Course 15 Messages arrive at a communication link simultaneously Transmitting one message at a time Transmitting messages concurrently Message arrives earlier Divide each message into packets Why networks use packets

16 Understanding Networked Applications A First Course 16 Transaction_1 Transaction_2 Shared resources Transaction_1Transaction_2 Transaction_1Transaction_2 Two concurrent transactions Give the same result as: Or: Isolation of transactions

17 Understanding Networked Applications A First Course 17 Queue Concurrency Messages among active objects An active object delegates a task to another active object, which retrieves from queue when ready Task

18 Understanding Networked Applications: A First Course Scalability by David G. Messerschmitt

19 Understanding Networked Applications A First Course 19 Definition An application is scalable if its performance parameters can be improved as necessary –Adding but not replacing equipment is acceptable –Re-configuration but not re-programming is acceptable –Normally equipment cost should increase no more than linearly with performance

20 Understanding Networked Applications A First Course 20 Basic technique Concurrent tasks are a key to scalability Some obstacles: –Concurrent tasks aren’t there –Dependency among tasks –Communication overhead –Variations in task loads result in congestion

21 Understanding Networked Applications A First Course 21 Some problems to try to avoid Blocking –Processing blocked waiting for external events –Make sure processor can work on something else Duplication –In creating concurrent tasks, duplication of effort is created

22 Understanding Networked Applications A First Course 22 Problems to avoid (con’t) Load balancing –Workload not equal among processors –Some processors not fully utilized –More difficult if concurrent tasks are dependent Congestion –Workload fluctuates –Makes load balancing more difficult because utilization can’t be predicted

23 Understanding Networked Applications A First Course 23 Mux & queue Irregular arrival of tasks Irregular task completion times Server Source of congestion

24 Understanding Networked Applications A First Course 24 Congestion model Queue 1. Tasks arrive at random times 2. Tasks wait in queue waiting for processing 3. Task service time is random

25 Understanding Networked Applications A First Course 25 Statistical waiting time A specific statistical model for arrival times and service times is assumed Tradeoff between task completion time (waiting time) and task throughput (utilization)

26 Understanding Networked Applications A First Course 26 Example: Web server How do users know the server is reaching full utilization? When a single Web server/processor is exhausted, what do we do?

27 Understanding Networked Applications: A First Course Operating systems

28 Understanding Networked Applications A First Course 28 Some OS goals Abstraction: hide hardware details Manage concurrency –Multitasking (time-slicing) concurrency –Process and thread –Inter-process communicaton Manage resources –Memory, storage, processing, network access

29 Understanding Networked Applications A First Course 29 Processor cache Main memory Online (non-volatile) external storage Archive storage Off-line Size Speed Memory/storage hierarchy

30 Understanding Networked Applications A First Course 30 Processor Shared memory Processor Network interface Processor Private memory Processor Network interface Private memory Private memory High-speed communication bus

31 Understanding Networked Applications A First Course 31 OS kernel NetworkStorageMemory Process Memory Process Memory User level Kernel level Resources

32 Understanding Networked Applications A First Course 32 Process Kernel performs service, then returns KernelmodeUsermode Time write_file(), send_message(), etc.

33 Understanding Networked Applications A First Course 33 Thread nThread n+1 Request to HTTP server to return homepage Page returned Another request Shared repository of WWW links Another return Threads

34 Understanding Networked Applications: A First Course Supplements By David G. Messerschmitt

35 Understanding Networked Applications A First Course 35 Execution models for objects Active object –Independent center of activity –Works without methods being called Passive object –Works only in response to method invocations

36 Understanding Networked Applications A First Course 36 Two observations For anything to get done, there has to be at least one active object! Natural for each active object to work on one task at a time –If so there must be at least two active objects for concurrency –(although in principle an active object could time slice among tasks, this is much more complicated and not a good idea)

37 Understanding Networked Applications A First Course 37 Active objectPassive objects Executing Time One object is executing at a time Natural for each active object to work on one task Task

38 Understanding Networked Applications A First Course 38 Active object Active object Passive objects Concurrency with two active objects

39 Understanding Networked Applications A First Course 39 Concurrency Active object Active object Passive objects Potential resource conflict A possible problem

40 Understanding Networked Applications A First Course 40 Stage1Stage2Stage3 Partially completed piece of work Task Without pipelining

41 Understanding Networked Applications A First Course 41 Stage1Stage2Stage3Task_complete Task_start Repetitive tasks With pipelining


Download ppt "Understanding Networked Applications: A First Course Chapter 17 by David G. Messerschmitt."

Similar presentations


Ads by Google