We investigate high-performance threading architectures for I/O intensive multi-threaded servers. We study thread architectures from two angles: (1) number of user threads per kernel thread, and (2) use of synchronous I/O vs. asynchronous I/O. We underline the shortcomings of 1-to-1 threads with synchronous I/O, N-to-1 threads with asynchronous I/O, and N-to-M threads with synchronous I/O with respect to server performance We propose N-toM threads with asynchronous I/O, a novel and previously unexplored thread model, for such servers. We explain the architectural benefits of this thread model over the above mentioned architectures. We have designed and implemented ServLib, a thread library, modeled in this architecture. We optimize ServLib to reduce context switches for large I/O transfers. ServLib exports standard POSIX threads (pthreads) API and can be slipped transparently beneath any multi-threaded application using such API. We have evaluated ServLib with two applications, the Apache multi-threaded web server, and the MySQL multi-threaded database server. Our results show that for synthetic and real workloads Apache with ServLib registers a performance improvement of 10-25% over Apache with 1-to-1 thread and N-to-1 thread libraries. For TPC-W workload, ServLib improves the performance of MySQL by 10-17% over 1-to-1 and N-to-1 thread libraries.
[1]
Willy Zwaenepoel,et al.
Flash: An efficient and portable Web server
,
1999,
USENIX Annual Technical Conference, General Track.
[2]
Scott Rixner,et al.
Increasing web server throughput with network interface data caching
,
2002,
ASPLOS X.
[3]
Nathan J. Williams,et al.
Proceedings of the Freenix Track: 2002 Usenix Annual Technical Conference an Implementation of Scheduler Activations on the Netbsd Operating System
,
2022
.
[4]
Brian N. Bershad,et al.
Scheduler activations: effective kernel support for the user-level management of parallelism
,
1991,
TOCS.
[5]
James R. Larus,et al.
Using Cohort-Scheduling to Enhance Server Performance
,
2002,
USENIX Annual Technical Conference, General Track.
[6]
David E. Culler,et al.
SEDA: an architecture for well-conditioned, scalable internet services
,
2001,
SOSP.