0
# A Web Server Called *Ebb*
0
-The design is similar to the [Evented Mongrel][1] web server; except instead
0
-of using EventMachine (a ruby binding to libevent), the Ebb web server is written in C and uses the [libev][2] event loop library.
0
+Ebb aims to be a very small and fast web server specifically for hosting
0
+web frameworks like Rails, Merb, and in the future Django.
0
-Connections are processed as follows:
0
+It is *not* meant to be a full featured web server like Lighttpd, Apache, or
0
+Nginx. Rather it should be used in multiplicity behind a load balancer and
0
+a front-end server. It is not meant to serve static files in production.
0
-1. libev loops and waits for incoming connections.
0
-2. When Ebb can read from a client socket, it passes the buffer into the
0
- mongrel state machine which parses the headers into name value pairs.
0
-3. Ebb handles any file uploads
0
+The design is similar to the
0
+[Evented Mongrel](http://swiftiply.swiftcore.org/mongrel.html) web server;
0
+except instead of using EventMachine (a ruby binding to libevent), the Ebb
0
+web server is written in C and uses the
0
+[libev](http://software.schmorp.de/pkg/libev.html) event loop library.
0
-4. Ebb passes the request information and peer socket to a user
0
+Connections are processed as follows:
0
-5. The Ruby binding, ebb_ruby.c, supplying this callback transforms the
0
- request into a Rack compatible "env" hash and passes it on a Rack
0
+1. libev loops and waits for incoming connections.
0
+2. When Ebb receives a connection, it passes the request into the
0
+ [mongrel state machine](http://mongrel.rubyforge.org/browser/tags/rel_1-0-1/ext/http11/http11_parser.rl)
0
+ which securely parses the headers.
0
+3. When the request is complete, Ebb passes the information to a user
0
+4. The Ruby binding supplying this callback transforms the
0
+ request into a [Rack](http://rack.rubyforge.org/) compatible `env` hash
0
+ and passes it on a Rack adapter.
0
Because Ebb is written mostly in C, other language bindings can be added to
0
make it useful to Non-Ruby frameworks. For example, a Python WSGI interface is
0
-Ebb aims to be the smallest and fastest web server possible specifically for
0
-doing the processing for web frameworks like Rails, Merb, and Django.
0
+The Ruby binding is available as a Ruby Gem. It can be install simply by
0
+Ebb depends on having glib2 headers and libraries installed. (Easily available
0
-Why? Because by building the server in C one is able to side-step the limitations on speed of many scripting languages. Inefficiencies are okay for quick and beautiful code, but for production web servers that might handle thousands of requests a second, an attempt should be made to be as efficient as possible.
0
+Because by building the server in C one is able to side-step the
0
+limitations on speed of many scripting languages. Inefficiencies are okay
0
+for quick and beautiful code, but for production web servers that might handle
0
+thousands of requests a second, an attempt should be made to be as efficient
0
+as possible in processing connections.
0

0
+This shows how the web servers perform with respect to throughput (using a
0
+simple Rack application). Concurrency is at 50 clients.
0

0
+A simple concurrent clients benchmark serving a *hello world* page.
0

0
+Ebb processes upload before handing it over to the web application. This
0
+allows Ebb to continue to process other clients while the upload is in
0
+progress. The large difference here is merely because Ebb's internal request
0
+buffer is set at 40 kilobytes before it writes to file. (Improvement can
0
+Contributions (patches, criticism, advice) are very welcome! The source code
0
+it hosted at [repo.or.cz](http://repo.or.cz/w/ebb.git) can be gotten by
0
+`git clone http://repo.or.cz/r/ebb.git`
0
+I intend to keep the C code base very small. Do email me before writing any
0
+large additions. Here are some features that I want to add:
0
+* Optimize and clean up upload handling
0
* Option to listen on unix sockets instead of TCP
0
-Copyright (c) 2007 Ryan Dahl
0
-> Permission is hereby granted, free of charge, to any person obtaining
0
-> a copy of this software and associated documentation files (the
0
-> "Software"), to deal in the Software without restriction, including
0
-> without limitation the rights to use, copy, modify, merge, publish,
0
-> distribute, sublicense, and/or sell copies of the Software, and to
0
-> permit persons to whom the Software is furnished to do so, subject to
0
-> the following conditions:
0
-> The above copyright notice and this permission notice shall be
0
-> included in all copies or substantial portions of the Software.
0
-> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0
-> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
0
-> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0
-> NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
0
-> LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
0
-> OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
0
-> WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0
- [1]: http://swiftiply.swiftcore.org/mongrel.html
0
- [2]: http://software.schmorp.de/pkg/libev.html
0
+Copyright © 2008 [Ry Dahl](http://tinyclouds.org) (ry at tiny clouds dot org)
0
+Permission is hereby granted, free of charge, to any person obtaining
0
+a copy of this software and associated documentation files (the
0
+"Software"), to deal in the Software without restriction, including
0
+without limitation the rights to use, copy, modify, merge, publish,
0
+distribute, sublicense, and/or sell copies of the Software, and to
0
+permit persons to whom the Software is furnished to do so, subject to
0
+the following conditions:
0
+The above copyright notice and this permission notice shall be
0
+included in all copies or substantial portions of the Software.
0
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
0
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
0
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
0
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
0
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0
\ No newline at end of file
Comments
No one has commented yet.