ry / ebb fork watch download tarball
public this repo is viewable by everyone
Description: web server
Homepage: http://ebb.rubyforge.org
Clone URL: git://github.com/ry/ebb.git
site update
Ryan Dahl (author)
about 1 month ago
commit  86b056ad218153dd3c39f1132e95361ac4f7f9b1
tree    d0447dd154c7789869bf94d6b61eddedc7037fcf
parent  0a8a18b02139cfad50d1d7c89b1b1f49ab687fbd
...
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
...
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
 
93
94
 
 
95
96
 
97
98
99
100
101
 
 
 
 
 
102
103
104
105
106
 
 
107
108
109
...
1
2
3
 
4
5
6
7
 
 
 
8
9
10
11
12
13
14
15
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
18
19
20
...
51
52
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
55
 
56
57
58
 
59
60
 
 
 
 
61
62
63
64
65
66
67
68
69
 
70
71
72
73
74
0
@@ -1,39 +1,20 @@
0
 # A Web Server Called *Ebb*
0
 
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
 
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
 
0
-## Design
0
-
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
-event loop.
0
-
0
-Connections are processed as follows:
0
-
0
-1. libev loops and waits for incoming connections.
0
-
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
-
0
-3. When the request is complete, Ebb passes the information to a user
0
- supplied callback.
0
-
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
-
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
-forthcoming.
0
+A Python-WSGI binding is under development.
0
 
0
 ## Install
0
 
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
 
0
-## Why?
0
-
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
-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
-![Response Size](http://s3.amazonaws.com/four.livejournal/20080227/response_size.png)
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
-![Concurrency](http://s3.amazonaws.com/four.livejournal/20080227/concurrency.png)
0
+## Speed
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
-![Uploads](http://s3.amazonaws.com/four.livejournal/20080227/post_size.png)
0
+![Benchmark](http://s3.amazonaws.com/four.livejournal/20080311/ebb.png)
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
 
0
 ## Contributions
0
 
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
+Please send all to to
0
+[the mailing list](http://groups.google.com/group/ebbebb).
0
 
0
 The source code
0
 is hosted [github](http://github.com/ry/ebb/tree/master). It can be retrieved
...
9
10
11
12
 
13
14
15
...
21
22
23
24
 
25
26
27
...
33
34
35
36
 
37
38
39
...
9
10
11
 
12
13
14
15
...
21
22
23
 
24
25
26
27
...
33
34
35
 
36
37
38
39
0
@@ -9,7 +9,7 @@ body {
0
   color: #444130;
0
   font-family: bell mt,georgia,helvetica;
0
   line-height: 15pt;
0
- font-size: 14pt;
0
+ font-size: 13pt;
0
   margin: 0;
0
 }
0
 
0
@@ -21,7 +21,7 @@ h1, h2, h3, h4 {
0
 
0
 pre, code {
0
   font-family: Courier;
0
- font-size: 12pt;
0
+ font-size: 11pt;
0
   overflow: auto;
0
 }
0
 
0
@@ -33,7 +33,7 @@ a { color: #E4AC3D; }
0
 
0
 #content {
0
   margin: 1em auto ;
0
- max-width: 30em;
0
+ max-width: 35em;
0
 }
0
 
0
 ol, ul { padding-left: 0; }

Comments

    No one has commented yet.