3 difficult things
• Network I/O is the largest bottleneck
• Need to handle a vast amount of requests
at once
• Need to handle various HTTP clients
(fast / slow / unstable)
Why fast?
1. Better architecture
2. The libev event library
3. Fast HTTP & URI parsing
Event-driven
• Handle many
clients at the same
time
• Asnyc ACCEPT/
READ/WRITE
• ex) Woo, Wookie,
Tornado, nginxServer process
(single-threaded)
Event loop
libev
• Wrapper of epoll, kqueue, POSIX select, poll
• Thin
• Fast
• Poor Windows support
• I don’t think people run a web server on
Windows
First choice: cl-async
• Wookie built on top of cl-async
• cl-async was used to use libevent2
• Node.js uses libuv
• libevent2 might be the bottleneck
• cl-async has moved to libuv now
HTTP parsing can be a bottleneck
• Wookie's largest bottleneck is HTTP parsing
• http-parse (uses regular expression)
• fast-http (byte to byte parser)
• 135 times faster than http-parse
• http://slideshare.net/fukamachi/writing-
a-fast-http-parser
URI parsing can be a bottleneck
• Wookie & Woo parses URI for dispatching
• PURI is *not really* fast
• QURI
• 6 times faster than PURI
Photo by Robert Couse-Baker licensed under the CC BY 2.0
Status
• Still alpha version
• Use at your own risk
• Tested with SBCL on Linux/Mac OS
• The latest bug:
• Cannot run in Americas (TZ problem)