Flash: An efficient and portable Web server Authors: Vivek S. Pai, Peter Druschel, Willy Zwaenepoel...

18
Flash: An efficient and portable Web server Authors: Vivek S. Pai, Peter Druschel, Willy Zwaenepoel Presented at the Usenix Technical Conference, June 1999 Presented by Richard Ta-Min

Transcript of Flash: An efficient and portable Web server Authors: Vivek S. Pai, Peter Druschel, Willy Zwaenepoel...

Page 1: Flash: An efficient and portable Web server Authors: Vivek S. Pai, Peter Druschel, Willy Zwaenepoel Presented at the Usenix Technical Conference, June.

Flash: An efficient and portable Web server

Authors: Vivek S. Pai, Peter Druschel, Willy Zwaenepoel

Presented at the Usenix Technical Conference, June 1999

Presented by Richard Ta-Min

Page 2: Flash: An efficient and portable Web server Authors: Vivek S. Pai, Peter Druschel, Willy Zwaenepoel Presented at the Usenix Technical Conference, June.

Introduction

• Web servers need to be fast and able to service many requests concurrently

• Three web server architectures– Multi-process and multi-thread

• Apache web server

– Single process event driven• Zeus web server

– Asymmetric multi process event driven• Flash web server

Page 3: Flash: An efficient and portable Web server Authors: Vivek S. Pai, Peter Druschel, Willy Zwaenepoel Presented at the Usenix Technical Conference, June.

Processing of HTTP request

Page 4: Flash: An efficient and portable Web server Authors: Vivek S. Pai, Peter Druschel, Willy Zwaenepoel Presented at the Usenix Technical Conference, June.

Processing of HTTP request

Data not ready to be read from socket

stat() and open() sys call may block on disk

I/O

read() and write() sys call may block too

Page 5: Flash: An efficient and portable Web server Authors: Vivek S. Pai, Peter Druschel, Willy Zwaenepoel Presented at the Usenix Technical Conference, June.

Multiple Process - MP

• Each process handles one request• Disadvantages

– Each process has its separate address space– Cannot share data: separate cache– Context switch overhead

Page 6: Flash: An efficient and portable Web server Authors: Vivek S. Pai, Peter Druschel, Willy Zwaenepoel Presented at the Usenix Technical Conference, June.

Multiple Threads - MT

• Each thread handles one request• Advantages

– One address space: All threads share one cache– Less context switch overhead

• OS has to support kernel threads• Apache V2.0 can use threads

Page 7: Flash: An efficient and portable Web server Authors: Vivek S. Pai, Peter Druschel, Willy Zwaenepoel Presented at the Usenix Technical Conference, June.

Single Process Event Driven - SPED

• Single thread of execution• Use non-blocking system calls to perform I/O

operations• Used by Zeus web server

Page 8: Flash: An efficient and portable Web server Authors: Vivek S. Pai, Peter Druschel, Willy Zwaenepoel Presented at the Usenix Technical Conference, June.

Single Process Event Driven - SPED

• SPED should be able to process many requests at a time but …

• Non-blocking read/write don’t work on disk operations

Disk I/O operations still block

Page 9: Flash: An efficient and portable Web server Authors: Vivek S. Pai, Peter Druschel, Willy Zwaenepoel Presented at the Usenix Technical Conference, June.

Asymmetric Multi Process Event Driven

• Combination of MP and SPED• Use non-blocking calls to perform network

and pipe operations• Use helper process to perform blocking disk

I/O operations

Page 10: Flash: An efficient and portable Web server Authors: Vivek S. Pai, Peter Druschel, Willy Zwaenepoel Presented at the Usenix Technical Conference, June.

Asymmetric Multi Process Event Driven

• Helper process can be a separate thread or process

• Master and Helper process communicate through IPC– Master and Helper mmap() the same request file– Helper process reads file from disk and brings into

memory– Helper notifies master that file is ready– Avoid data transfer between processes

Page 11: Flash: An efficient and portable Web server Authors: Vivek S. Pai, Peter Druschel, Willy Zwaenepoel Presented at the Usenix Technical Conference, June.

Flash Web Server

• Flash web server – implementation of the AMPED architecture

• Uses aggressive caching– Pathname translation caching– Response header caching– Caching of already mapped files

Page 12: Flash: An efficient and portable Web server Authors: Vivek S. Pai, Peter Druschel, Willy Zwaenepoel Presented at the Usenix Technical Conference, June.

Performance Evaluation

• Compare different web server architecture– Flash AMPED– Flash SPED– Flash MT– Flash MP– Apache V1.3.1– Zeus V1.30

Page 13: Flash: An efficient and portable Web server Authors: Vivek S. Pai, Peter Druschel, Willy Zwaenepoel Presented at the Usenix Technical Conference, June.

Test Platform

• Server– Speed: 333 MHz Pentium II– Memory: 128 MB

• Operating System– Solaris 2.6– Free BSD 2.2.6 – No support for threads

• Clients– Software that simulates HTTP clients

Page 14: Flash: An efficient and portable Web server Authors: Vivek S. Pai, Peter Druschel, Willy Zwaenepoel Presented at the Usenix Technical Conference, June.

Synthetic Workload

• Clients request the same file repeatedly• Purpose to see how web server behaves

under best conditions

Solaris FreeBSD

Page 15: Flash: An efficient and portable Web server Authors: Vivek S. Pai, Peter Druschel, Willy Zwaenepoel Presented at the Usenix Technical Conference, June.

Trace Based Experiments

• Replay access logs from real web servers

Page 16: Flash: An efficient and portable Web server Authors: Vivek S. Pai, Peter Druschel, Willy Zwaenepoel Presented at the Usenix Technical Conference, June.

Trace Based Experiments

• Test server with workload of different data set size

Page 17: Flash: An efficient and portable Web server Authors: Vivek S. Pai, Peter Druschel, Willy Zwaenepoel Presented at the Usenix Technical Conference, June.

Trace Based Experiments

• Varying the number of clients

Page 18: Flash: An efficient and portable Web server Authors: Vivek S. Pai, Peter Druschel, Willy Zwaenepoel Presented at the Usenix Technical Conference, June.

Conclusion

• Efficient web server: Need to handle request and perform disk operations

• Web server architecture– MP/MT– SPED– AMPED – Combines efficiency of SPED and MP

• Flash web server based on AMPED outperforms Zeus and Apache