0
# A Web Server Called *Ebb*
0
Ebb aims to be a small and fast web server specifically for hosting
0
-web frameworks like Rails, Merb, and in the future Django.
0
+dynamic web applications. It is not meant to be a full featured web server
0
+like Lighttpd, Apache, or Nginx. Rather it should be used in multiplicity
0
+behind a load balancer and a front-end server. It is not meant to serve static files in production.
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 a
0
-front-end server. It is not meant to serve static files in production.
0
+At one level Ebb is a minimalist C library that ties together the
0
+[Mongrel state machine](http://mongrel.rubyforge.org/browser/tags/rel_1-0-1/ext/http11/http11_parser.rl)
0
+and [libev](http://software.schmorp.de/pkg/libev.html) event loop. One can use
0
+this library to drive a web application written in C. (Perhaps for embedded
0
+devices?) However, most people will be interested in the binding of this
0
+library to the Ruby programming language. The binding provides a
0
+[Rack](http://rack.rubyforge.org/) server interface that allows it to host
0
+Rails, Merb, or other frameworks.
0
-The design is similar to the [Evented
0
-Mongrel](http://swiftiply.swiftcore.org/mongrel.html) web server; except
0
-instead of using [EventMachine](http://rubyeventmachine.com/) to drive
0
-network interactions, the Ebb web server handles sockets directly in C and
0
-employs the use of the [libev](http://software.schmorp.de/pkg/libev.html)
0
-Connections are processed as follows:
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
+A Python-WSGI binding is under development.
0
@@ -70,40 +51,24 @@ When using `ebb_rails` from monit, the monitrc entry might look like this:
0
To use Ebb with a different framework you will have to do a small amount of
0
hacking at the moment! :)
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
-Following are some benchmarks. Please take these measurements with a grain of
0
-salt. Benchmarks like these are notorious for presenting an inaccurate or
0
-highly slanted view of how software performs. These are tests using a very
0
-simple Rack applications, not with Ruby-on-Rails. The code for these can be
0
-found in the `benchmark` directory.
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
+Because Ebb-Ruby handles most of the processing in C, it is able to do work
0
+often times more efficiently than other Ruby language web servers.
0
-
0
+
0
-Ebb processes uploads 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 cliff at 40k here is because Ebb's internal request
0
-buffer is set at 40 kilobytes before it writes to file.
0
+Ebb-Ruby can handle threaded processing better than the other 'evented'
0
+servers. This won't be of any benefit to Rails applications because Rails
0
+places a lock around each request that wouldn't allow concurrent processing
0
+anyway. In Merb, for example, Ebb's thread handling will allow Ebb instances
0
+to handle larger loads. [More](http://four.livejournal.com/848525.html)
0
Contributions (patches, criticism, advice) are very welcome!
0
-All should be posted to http://groups.google.com/group/ebbebb or emailed to me.
0
+[the mailing list](http://groups.google.com/group/ebbebb).
0
is hosted [github](http://github.com/ry/ebb/tree/master). It can be retrieved
Comments
No one has commented yet.