Code Development for High Performance Servers Topics Multithreaded Servers Event Driven Servers Example - Game Server code (Quake) A parallelization exercise.

Slides:



Advertisements
Similar presentations
Lazy Asynchronous I/O For Event-Driven Servers Khaled Elmeleegy, Anupam Chanda and Alan L. Cox Department of Computer Science Rice University, Houston,
Advertisements

N ODE.J S S ERVER S IDE J AVASCRIPT Diana Roiswati ( ) Ahmad Syafii ( ) Asri Taraqiadiyu ( )
Flash: An efficient and portable Web server Authors: Vivek S. Pai, Peter Druschel, Willy Zwaenepoel Presented at the Usenix Technical Conference, June.
1 SEDA: An Architecture for Well- Conditioned, Scalable Internet Services Matt Welsh, David Culler, and Eric Brewer Computer Science Division University.
CS533 Concepts of Operating Systems Jonathan Walpole.
ECE 526 – Network Processing Systems Design Software-based Protocol Processing Chapter 7: D. E. Comer.
CS533 Concepts of Operating Systems Class 5 Event-Based Systems.
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services Matt Welsh, David Culler, and Eric Brewer Computer Science Division University of.
Precept 3 COS 461. Concurrency is Useful Multi Processor/Core Multiple Inputs Don’t wait on slow devices.
CS533 Concepts of Operating Systems Class 5 Event-Based Systems.
Server Architecture Models Operating Systems Hebrew University Spring 2004.
CS533 Concepts of Operating Systems Class 5 Event-Based Systems.
CS533 Concepts of Operating Systems Class 2 Thread vs Event-Based Programming.
Chapter 4: Threads. 4.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005 Chapter 4: Threads Overview Multithreading.
CS533 Concepts of Operating Systems Class 2 The Duality of Threads and Events.
Threads CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services
 A JavaScript runtime environment running Google Chrome’s V8 engine ◦ a.k.a. a server-side solution for JS ◦ Compiles JS, making it really fast  Runs.
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services by, Matt Welsh, David Culler, and Eric Brewer Computer Science Division University.
Flash An efficient and portable Web server. Today’s paper, FLASH Quite old (1999) Reading old papers gives us lessons We can see which solution among.
1 Lecture 4: Threads Operating System Fall Contents Overview: Processes & Threads Benefits of Threads Thread State and Operations User Thread.
Today’s topic Other server design alternatives –Preforked servers –Threaded servers –Prethreaded servers.
Operating System Concepts Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University.
Threads Many software packages are multi-threaded Web browser: one thread display images, another thread retrieves data from the network Word processor:
Rapid Development of High Performance Servers Khaled ElMeleegy Alan Cox Willy Zwaenepoel.
Background: Operating Systems Brad Karp UCL Computer Science CS GZ03 / M th November, 2008.
CS333 Intro to Operating Systems Jonathan Walpole.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 4: Threads.
Processes & Threads Introduction to Operating Systems: Module 5.
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services Matt Welsh, David Culler, and Eric Brewer Computer Science Division University of.
CSC 360, Instructor: Kui Wu Thread & PThread. CSC 360, Instructor: Kui Wu Agenda 1.What is thread? 2.User vs kernel threads 3.Thread models 4.Thread issues.
Threads versus Events CSE451 Andrew Whitaker. This Class Threads vs. events is an ongoing debate  So, neat-and-tidy answers aren’t necessarily available.
Cs431-cotter1 Processes and Threads Tanenbaum 2.1, 2.2 Crowley Chapters 3, 5 Stallings Chapter 3, 4 Silberschaz & Galvin 3, 4.
1 Why Threads are a Bad Idea (for most purposes) based on a presentation by John Ousterhout Sun Microsystems Laboratories Threads!
for Event Driven Servers
Multithreading vs. Event Driven in Code Development of High Performance Servers.
Introduction to Operating Systems Concepts
Chapter 4: Threads.
Node.Js Server Side Javascript
Process concept.
Threads vs. Events SEDA – An Event Model 5204 – Operating Systems.
CS 6560: Operating Systems Design
CSE 775 – Distributed Objects Submitted by: Arpit Kothari
CSCS 511 Operating Systems Ch3, 4 (Part B) Further Understanding Threads Dr. Frank Li Skipped sections 3.5 & 3.6 
Scheduler activations
CS399 New Beginnings Jonathan Walpole.
Chapter 4: Multithreaded Programming
Threads, Events, and Scheduling
Netty.
Node.Js Server Side Javascript
Capriccio – A Thread Model
CSCI 511 Operating Systems Ch3, 4 (Part B) Further Understanding Threads Dr. Frank Li Skipped sections 3.5 & 3.6 
Chapter 4: Threads.
Threads and Concurrency
Threads, Events, and Scheduling
Fine-grained vs Coarse-grained multithreading
EE 472 – Embedded Systems Dr. Shwetak Patel.
CS533 Concepts of Operating Systems Class 7
Threads, Events, and Scheduling
Why Threads Are A Bad Idea (for most purposes)
Introduction to Concurrency CSE 333 Autumn 2018
Process Management -Compiled for CSIT
Chapter 4: Threads.
Why Threads Are A Bad Idea (for most purposes)
Why Threads Are A Bad Idea (for most purposes)
Introduction to Concurrency CSE 333 Winter 2019
Threads -For CSIT.
Threads CSE 2431: Introduction to Operating Systems
Chapter 4:Threads Book: Operating System Principles , 9th Edition , Abraham Silberschatz, Peter Baer Galvin, Greg Gagne.
CS Introduction to Operating Systems
Presentation transcript:

Code Development for High Performance Servers Topics Multithreaded Servers Event Driven Servers Example - Game Server code (Quake) A parallelization exercise for game server code

– 2 – Goals Maximize server utilization and decrease its latency. Server process doesn’t block! Robust under heavy loads. Relatively easy to develop.

– 3 – One thread per request executing the request handler. Each thread is listening on a socket A thread blocking on I/O doesn’t block the server. Ex: Apache, MySql. Request Handler A B C Function Calls Multi-threaded Servers

– 4 – Multi-threaded Servers (Cont.) Advantages: + Relatively easy to develop.Disadvantages: Poor performance. Poor performance. Thread scheduling. Context switching. Doesn’t scale. Doesn’t scale. Under heavy load, many threads would be created exhausting kernel’s memory, crashing the server.

– 5 – Single thread (event loop). + High performance. + Scalable/Robust. -Hard to write Event Driven Servers Event Loop A1 B1 C1 A2 B2 C2 “Blocking” operation

– 6 – Background: AIO Asynchronous I/O mainly used for disk reads/writes. Issue disk request and return immediately without blocking for results. On completion an event is raised.

– 7 – Single thread (event loop). Hard to write (server can’t block !) -AIO operations. -Requests (events) put in Event Queue. -Continuations (for requests) - When receiving a reply Event Driven Servers (cont) Event Loop A1 B1 C1 A2 B2 C2 “Blocking” operation

– 8 – Summary YesNo High Performance NoYes Thread / request? NoYes >1 thread Zeus Web Server Apache, MySQL Examples NoYes “Easy” to build YesNoScalable Event Driven Multi- Threaded