ry / ebb fork watch download tarball
public
Description: web server
Homepage: http://ebb.rubyforge.org
Clone URL: git://github.com/ry/ebb.git
Search Repo:
Ryan Dahl (author)
Wed Feb 27 02:50:14 -0800 2008
commit  0e2dc886e26a1afc11882f3f6e999943d7af2478
tree    16962c1b0285b95935377ff46e3c15d9df38f2ff
parent  7897e7c5897e264fc0f80ee423ed393e606180cb
ebb / README
100644 72 lines (50 sloc) 2.943 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# A Web Server Called *Ebb*
 
## Design
 
The design is similar to the [Evented Mongrel][1] web server; except instead
of using EventMachine (a ruby binding to libevent), the Ebb web server is written in C and uses the [libev][2] event loop library.
 
Connections are processed as follows:
 
1. libev loops and waits for incoming connections.
 
2. When Ebb can read from a client socket, it passes the buffer into the
   mongrel state machine which parses the headers into name value pairs.
 
3. Ebb handles any file uploads
 
4. Ebb passes the request information and peer socket to a user
   supplied callback.
 
5. The Ruby binding, ebb_ruby.c, supplying this callback transforms the
   request into a Rack 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.
 
Ebb aims to be the smallest and fastest web server possible specifically for
doing the processing for web frameworks like Rails, Merb, and Django.
 
## Why?
 
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.
 
![Response Size](http://s3.amazonaws.com/four.livejournal/20080227/response_size.png)
 
![Concurrency](http://s3.amazonaws.com/four.livejournal/20080227/concurrency.png)
 
![Uploads](http://s3.amazonaws.com/four.livejournal/20080227/post_size.png)
 
## Download
 
 
## TODO
* Option to listen on unix sockets instead of TCP
* Python binding
 
## License
 
Copyright (c) 2007 Ryan Dahl
 
> 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.
 
  [1]: http://swiftiply.swiftcore.org/mongrel.html
  [2]: http://software.schmorp.de/pkg/libev.html