Ensure request is sent even if ebb_client_body_write isn't called
[ebb.git] / README
blobf383fbd5f329c7fdad608122806584025a2bbf14
1 # A Web Server Called *Ebb*
3 Ebb aims to be a small and fast web server specifically for hosting 
4 dynamic web applications. It is not meant to be a full featured web server
5 like Lighttpd, Apache, or Nginx. Rather it should be used in multiplicity
6 behind a load balancer and a front-end server. It is not meant to serve static files in production.
8 At one level Ebb is a minimalist C library that ties together the 
9 [Mongrel state machine](http://mongrel.rubyforge.org/browser/tags/rel_1-0-1/ext/http11/http11_parser.rl) 
10 and [libev](http://software.schmorp.de/pkg/libev.html) event loop. One can use
11 this library to drive a web application written in C. (Perhaps for embedded 
12 devices?) However, most people will be interested in the binding of this
13 library to the Ruby programming language. The binding provides a
14 [Rack](http://rack.rubyforge.org/) server interface that allows it to host
15 Rails, Merb, or other frameworks.
17 A Python-WSGI binding is under development.
19 ## Install
21 The Ruby binding is available as a Ruby Gem. It can be install by executing
23     gem install ebb
25 Ebb depends on having glib2 headers and libraries installed. For example, in
26 Macintosh if one is using Darwin ports then the following should do the trick
27   
28     port install glib2
29   
30 Downloads are available at
31 the [RubyForge project page](http://rubyforge.org/frs/?group_id=5640).
33 ## Running
35 Using the executable `ebb_rails` one can start Ebb with a Rails project. Use
36 `ebb_rails -h` to see all of the options but to start one can try
38     cd my_rails_project/
39     ebb_rails start
41 When using `ebb_rails` from monit, the monitrc entry might look like this:
43     check process myApp4000
44       with pidfile /home/webuser/myApp/current/tmp/ebb.4000.pid
45       start program = "/usr/bin/ruby /usr/bin/ebb_rails start -d -e production -p 4000 -P /home/webuser/myApp/current/tmp/ebb.4000.pid -c /home/webuser/myApp/current" as uid webuser and gid webuser
46       stop program = "/usr/bin/ruby /usr/bin/ebb_rails stop -P /home/webuser/myApp/current/tmp/ebb.4000.pid" as uid webuser and gid webuser
47       if totalmem > 120.0 MB for 2 cycles then restart
48       if loadavg(5min) greater than 10 for 8 cycles then restart
49       group myApp
51 To use Ebb with a different framework you will have to do a small amount of
52 hacking at the moment! :)
54 ## Speed
56 Because Ebb handles most of the processing in C, it is able to do work
57 often times more efficiently than other Ruby language web servers.
59 ![Benchmark](http://s3.amazonaws.com/four.livejournal/20080311/ebb.png)
61 Ebb-Ruby can handle threaded processing better than the other 'evented' 
62 servers. This won't be of any benefit to Rails applications because Rails
63 places a lock around each request that wouldn't allow concurrent processing
64 anyway. In Merb, for example, Ebb's thread handling will allow Ebb instances
65 to handle larger loads. [More](http://four.livejournal.com/848525.html)
67 ## Contributions
69 Contributions (patches, criticism, advice) are very welcome! 
70 Please send all to to 
71 [the mailing list](http://groups.google.com/group/ebbebb).
73 The source code is hosted [github](http://github.com/ry/ebb/tree/master). It
74 can be retrieved by executing
76     git clone git://github.com/ry/ebb.git
78 Here are some features that I would like to add:
79 * HTTP 1.1 Expect/Continue (RFC 2616, sections 8.2.3 and 10.1.1)
80 * A parser for multipart/form-data (only for optimization - this functionality is currently handled at the framework level)
81 * Python binding
83 ## (The MIT) License
85 Copyright © 2008 [Ry Dahl](http://tinyclouds.org) (ry at tiny clouds dot org)
87 <div id="license">
88 Permission is hereby granted, free of charge, to any person obtaining
89 a copy of this software and associated documentation files (the
90 "Software"), to deal in the Software without restriction, including
91 without limitation the rights to use, copy, modify, merge, publish,
92 distribute, sublicense, and/or sell copies of the Software, and to
93 permit persons to whom the Software is furnished to do so, subject to
94 the following conditions:
96 The above copyright notice and this permission notice shall be
97 included in all copies or substantial portions of the Software.
99 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
100 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
101 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
102 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
103 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
104 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
105 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
106 </div>