This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Ryan Dahl (author)
Wed Mar 12 18:02:12 -0700 2008
commit 0b99f32b9ab81caeded14787715248be370b3b22
tree fec1fad101d7b74fe409e792d025d4f4efaa5423
parent 16283806a21a4989aae8bbc8cbc3558f6a36db90
tree fec1fad101d7b74fe409e792d025d4f4efaa5423
parent 16283806a21a4989aae8bbc8cbc3558f6a36db90
ebb /
| name | age | message | |
|---|---|---|---|
| |
README | Wed Mar 12 10:44:11 -0700 2008 | [Ryan Dahl] |
| |
Rakefile | Wed Mar 12 18:02:12 -0700 2008 | [Ryan Dahl] |
| |
benchmark/ | Wed Mar 12 18:02:12 -0700 2008 | [Ryan Dahl] |
| |
bin/ | Sun Mar 09 07:39:00 -0700 2008 | [Ryan Dahl] |
| |
libev/ | Sun Feb 17 09:45:36 -0800 2008 | [Ryan Dahl] |
| |
ruby_lib/ | Wed Mar 12 18:02:12 -0700 2008 | [Ryan Dahl] |
| |
setup.py | Tue Mar 04 04:31:44 -0800 2008 | [Ryan Dahl] |
| |
site/ | Thu Feb 28 03:31:42 -0800 2008 | [Ryan Dahl] |
| |
src/ | Wed Mar 12 18:02:12 -0700 2008 | [Ryan Dahl] |
| |
test/ | Wed Mar 12 18:02:12 -0700 2008 | [Ryan Dahl] |
README
# A Web Server Called *Ebb* Ebb aims to be a small and fast web server specifically for hosting web frameworks like Rails, Merb, and in the future Django. It is not meant to be a full featured web server like Lighttpd, Apache, or Nginx. Rather it should be used in multiplicity behind a [load balancer](http://brainspl.at/articles/2007/11/09/a-fair-proxy-balancer-for-nginx-and-mongrel) and a front-end server. It is not meant to serve static files in production. ## Design The design is similar to the [Evented Mongrel](http://swiftiply.swiftcore.org/mongrel.html) web server; except instead of using [EventMachine](http://rubyeventmachine.com/) to drive network interactions, the Ebb web server handles sockets directly in C and employs the use of the [libev](http://software.schmorp.de/pkg/libev.html) event loop. Connections are processed as follows: 1. libev loops and waits for incoming connections. 2. When Ebb receives a connection, it passes the request into the [mongrel state machine](http://mongrel.rubyforge.org/browser/tags/rel_1-0-1/ext/http11/http11_parser.rl) which securely parses the headers. 3. When the request is complete, Ebb passes the information to a user supplied callback. 4. The Ruby binding supplying this callback transforms the request into a [Rack](http://rack.rubyforge.org/) compatible `env` hash and passes it on a Rack adapter. Because Ebb is written mostly in C, other language bindings can be added to make it useful to Non-Ruby frameworks. For example, a Python WSGI interface is forthcoming. ## Install The Ruby binding is available as a Ruby Gem. It can be install by executing `gem install ebb` Ebb depends on having glib2 headers and libraries installed. For example, in Macintosh if one is using Darwin ports then the following should do the trick `port install glib2` Downloads are available at the [RubyForge project page](http://rubyforge.org/frs/?group_id=5640). ## Running Using the executable `ebb_rails` one can start Ebb with a Rails project. Use `ebb_rails -h` to see all of the options but to start one can try `cd my_rails_project/; ebb_rails start` To use Ebb with a different framework you will have to do a small amount of hacking at the moment! :) ## 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 in processing connections. Following are some benchmarks. Please take these measurements with a grain of salt. Benchmarks like these are notorious for presenting an inaccurate or highly slanted view of how software performs. These are tests using a very simple Rack applications, not with Ruby-on-Rails. The code for these can be found in the `benchmark` directory.  This shows how the web servers perform with respect to throughput (using a simple Rack application). Concurrency is at 50 clients.  A simple concurrent clients benchmark serving a *hello world* page.  Ebb processes uploads before handing it over to the web application. This allows Ebb to continue to process other clients while the upload is in progress. The cliff at 40k here is because Ebb's internal request buffer is set at 40 kilobytes before it writes to file. ## Contributions Contributions (patches, criticism, advice) are very welcome! The source code is hosted [github](http://github.com/ry/ebb/tree/master). It can be retrieved by executing `git clone git@github.com:ry/ebb.git` I intend to keep the C code base very small, so do email me before writing any large additions. Here are some features that I would like to add: * HTTP 1.1 Expect/Continue (RFC 2616, sections 8.2.3 and 10.1.1) * A parser for multipart/form-data * Optimize and clean up upload handling * Option to listen on unix sockets instead of TCP * Python binding ## (The MIT) License Copyright © 2008 [Ry Dahl](http://tinyclouds.org) (ry at tiny clouds dot org) <div id="license"> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. </div>




