Flash: An Efficient and Portable Web Server - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Flash: An Efficient and Portable Web Server

Description:

In practice, disk reads still block. Accept. Conn. Read. Request. Find. File. Send. Header. Read File. Send Data. Event Dispatcher. Asynchronous Multi-Process ... – PowerPoint PPT presentation

Number of Views:56
Avg rating:3.0/5.0
Slides: 11
Provided by: r335
Category:

less

Transcript and Presenter's Notes

Title: Flash: An Efficient and Portable Web Server


1
Flash An Efficient and Portable Web Server
  • Based on paper by Pai et al.

2
Web Server Processing Steps
3
Multiple Process Architecture
Process 1

separate address spaces
Process N
  • Advantages
  • Simple programming while addressing blocking
    issue
  • Disadvantages
  • Many processes large context switch overheads
  • Consumes much memory
  • Optimizations involving sharing information among
    processes (e.g., caching) harder

4
Multiple Thread Architecture
  • Advantages
  • Lower context switch overheads
  • Shared address space simplifies optimizations
    (e.g., caches)
  • Disadvantages
  • Need kernel level threads (why?)
  • Some extra memory needed to support multiple
    stacks
  • Need thread-safe programs, synchronization

5
Single Process Event Driven (SPED)
Accept Conn
Read Request
Find File
Send Header
Read File Send Data
Event Dispatcher
  • Single threaded
  • Asynchronous (non-blocking) I/O
  • Advantages
  • Single address space
  • No synchronization
  • Disadvantages
  • In practice, disk reads still block

6
Asynchronous Multi-Process Event Driven (AMPED)
Accept Conn
Read Request
Find File
Send Header
Read File Send Data
Event Dispatcher
Helper 1
Helper 1
Helper 1
  • Like SPED, but use helper processes/thread for
    disk I/O
  • Use IPC to communicate with helper process
  • Advantages
  • Shared address space for most web server
    functions
  • Concurrency for disk I/O
  • Disadvantages
  • IPC between main thread and helper threads

7
Comparisons
8
Flash Implementation
  • Single main thread
  • Helper Processes
  • Implemented as processes for portability
  • Perform filename translation and reading disk
    blocks into memory
  • Spawned dynamically as needed kept on reserve
    when not active

9
Caches in Flash
  • Pathname translation - map requested filenames
    (e.g., /bob) and actual names (e.g.,
    /home/users/bob/public_html/index.html)
  • Response header - reuse response header info when
    same files requested repeatedly
  • Mapped files - reuse memory mapping of frequently
    used files

Accept Client Connection
Read HTTP Request Header
Pathname Translation Cache
Helper
Find File
Response Header Cache
Send HTTP Response Header
Read File Send Data
Mapped File Cache
Helper
10
Summary
  • Several architectural alternatives
  • Multi-process / Multi-threaded
  • Avoids blocking on network and disk operations
  • Single process event driven (SPED)
  • Efficiency via non-blocking calls
  • Fast but limited I/O concurrency
  • AMPED
  • Hybrid combining SPED and threads/processes for
    increased I/O concurrency
  • Empirical measurements indicate good performance
Write a Comment
User Comments (0)
About PowerShow.com