90 likes | 246 Views
A Scalable and Explicit Event Delivery Mechanism for UNIX. Gaurav Banga, Jeffrey C. Mogul and Peter Druschel. Introduction. read(), write() – can be blocked polling (by application) , allocate a single thread to each activity – not scalable allocate a moderate number of threads
E N D
A Scalable and Explicit Event Delivery Mechanism for UNIX Gaurav Banga, Jeffrey C. Mogul and Peter Druschel SNU DCS Lab.
Introduction • read(), write() – can be blocked • polling (by application) , allocate a single thread to each activity – not scalable • allocate a moderate number of threads • select() – to wait for events on multiple file descriptor, non-blocking I/O • internet servers need much larger descriptor sets (web server, database server) • select() scales poorly • state based vs event based SNU DCS Lab.
Select() • int select ( int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout) • check I/O availability If none are available, then select() blocks protocol modules change state awakens the blocked process • awakened process don’t know which descriptor has just become readable or writable • improved select() (previous work) • scalability ? SNU DCS Lab.
Event-based vs State-based • state-based view, event-based view • select() follows the state-based approach • but, kernle’s I/O subsystems deal with events • select() implementation must transform notifications from an internal event-based view to external state-based view • new API (event-based approach) – kernel reports a stream of events to the app. • excessive communication overhead, allocate storage proportional to the event rate SNU DCS Lab.
programming interface • the kernel tracks event arrivals for the descriptor • If multiple threads are interested in a descriptor. • declare_interest() reports the current state of the fd. • get_next_event – to wait for additional events (rvl - # of events) SNU DCS Lab.
Performance • modifying Digital UNIX V4.0D • Workload : S-Client software (realistic request loads), cold connections (large WAN delays) • System • proxy : 500MHz Digital Personal Workstation (Alpha 21164, 128MB RAM) • client : 4 166Mhz Pentium (64MB RAM, FreeBSD 2.2.6) • server : 300 MHz Pentium II (128MB RAM, FreeBSD 2.2.6) • 100Mbps Fast Ethernet • Alpha’s cycle counter SNU DCS Lab.
proxy performance • 32 hot connection • varied the number of cold connections between 0 and 2000 SNU DCS Lab.
proxy performance • 750 cold connection • measured response time SNU DCS Lab.