Files | Admin

Notes:

Release Name: 0.7.0

Notes:
Rainbows! is an HTTP server for sleepy Rack applications.  It is based on
Unicorn, but designed to handle applications that expect long
request/response times and/or slow clients.  For Rack applications not
heavily bound by slow external network dependencies, consider Unicorn
instead as it simpler and easier to debug.

* http://rainbows.rubyforge.org/
* rainbows-talk@rubyforge.org
* git://git.bogomips.org/rainbows.git

Changes:

keepalive_timeout (default: 2 seconds) is now supported to
disconnect idle connections.  Several new concurrency models
added include: NeverBlock, FiberSpawn and FiberPool; all of
which have only been lightly tested.  RevThreadSpawn loses
streaming input support to become simpler and faster for the
general cases.  AppPool middleware is now compatible with all
Fiber-based models including Revactor and NeverBlock.

A new document gives a summary of all the options we give you:

  http://rainbows.rubyforge.org/Summary.html

If you're using any of the Rev-based concurrency models, the
latest iobuffer (0.1.3) gem will improve performance.  Also,
RevThreadSpawn should become usable under MRI 1.8 with the next
release of Rev (0.3.2).



Changes: .document | 1 + Documentation/GNUmakefile | 5 +- Documentation/comparison.css | 6 + Documentation/comparison.haml | 297 ++++++++++++++++++++++++++++++++ GIT-VERSION-GEN | 2 +- GNUmakefile | 41 +++-- README | 60 ++++--- Summary | 7 + TODO | 10 +- bin/rainbows | 4 +- lib/rainbows.rb | 36 ++++- lib/rainbows/actor_spawn.rb | 29 +++ lib/rainbows/app_pool.rb | 23 ++- lib/rainbows/base.rb | 23 +-- lib/rainbows/const.rb | 2 +- lib/rainbows/dev_fd_response.rb | 6 + lib/rainbows/error.rb | 34 ++++ lib/rainbows/ev_core.rb | 15 +-- lib/rainbows/ev_thread_core.rb | 80 --------- lib/rainbows/event_machine.rb | 16 +- lib/rainbows/fiber.rb | 15 ++ lib/rainbows/fiber/base.rb | 112 ++++++++++++ lib/rainbows/fiber/io.rb | 65 +++++++ lib/rainbows/fiber/queue.rb | 35 ++++ lib/rainbows/fiber_pool.rb | 44 +++++ lib/rainbows/fiber_spawn.rb | 34 ++++ lib/rainbows/http_server.rb | 15 ++- lib/rainbows/never_block.rb | 69 ++++++++ lib/rainbows/rev.rb | 7 + lib/rainbows/rev/client.rb | 12 +- lib/rainbows/rev/core.rb | 7 +- lib/rainbows/rev/heartbeat.rb | 6 +- lib/rainbows/rev_thread_spawn.rb | 122 +++++++------- lib/rainbows/revactor.rb | 45 +++--- lib/rainbows/thread_pool.rb | 54 +++--- lib/rainbows/thread_spawn.rb | 66 ++++---- local.mk.sample | 16 +- rainbows.gemspec | 10 +- t/GNUmakefile | 21 ++- t/fork-sleep.ru | 10 + t/simple-http_FiberPool.ru | 9 + t/simple-http_FiberSpawn.ru | 9 + t/simple-http_NeverBlock.ru | 11 ++ t/sleep.ru | 2 + t/t0000-simple-http.sh | 13 ++- t/t0001-unix-http.sh | 13 ++- t/t0009-broken-app.sh | 56 ++++++ t/t0009.ru | 13 ++ t/t0010-keepalive-timeout-effective.sh | 42 +++++ t/t0011-close-on-exec-set.sh | 54 ++++++ t/t0300-async_sinatra.sh | 2 +- t/t9000-rack-app-pool.sh | 2 +- t/t9000.ru | 13 +- t/test-lib.sh | 18 ++- 54 files changed, 1359 insertions(+), 360 deletions(-) commit fea5a7d500c63032d48945dd4d3b2ab4dde19715 Author: Eric Wong Date: Sun Nov 29 19:58:16 2009 -0800 Rainbows! 0.7.0 keepalive_timeout (default: 2 seconds) is now supported to disconnect idle connections. Several new concurrency models added include: NeverBlock, FiberSpawn and FiberPool; all of which have only been lightly tested. RevThreadSpawn loses streaming input support to become simpler and faster for the general cases. AppPool middleware is now compatible with all Fiber-based models including Revactor and NeverBlock. A new document gives a summary of all the options we give you: http://rainbows.rubyforge.org/Summary.html If you're using any of the Rev-based concurrency models, the latest iobuffer (0.1.3) gem will improve performance. Also, RevThreadSpawn should become usable under MRI 1.8 with the next release of Rev (0.3.2). commit 87e760784176b967da2ca8d0db3f54fe6a97598f Author: Eric Wong Date: Sun Nov 29 20:19:40 2009 -0800 bin/rainbows: do not expand paths given by shell Shells already expand '~' before the executables see it, and relative paths inside symlinks can get set incorrectly to the actual directory name, and not the (usually desired) symlink name for things like Capistrano. Since our paths are now unexpanded, we must now check the "working_directory" directive and raise an error if the user specifies the config file in a way that makes the config file unreloadable. commit b7bc89356dbeb7c16c6c6cb701c0225fd7c643f2 Author: Eric Wong Date: Sun Nov 29 20:10:07 2009 -0800 rev/core: don't set IOBuffer.default_node_size iobuffer 0.1.3 already sets this. commit ba0c2d925403c09343d6168fd8f72d148954206d Author: Eric Wong Date: Sun Nov 29 19:55:53 2009 -0800 update gem dependency recommendations commit 8e5a5841651bde69e95bc3e5751858a05b6635bd Author: Eric Wong Date: Sun Nov 29 19:49:30 2009 -0800 event_machine: small noise reduction cleanup commit 990e7d655f2617e705cf6a16449da24353547883 Author: Eric Wong Date: Sun Nov 29 19:40:18 2009 -0800 doc: add NeverBlock to comparison and README commit c19c57b963ff3d8959554b455c884ba944aadcd2 Author: Eric Wong Date: Sun Nov 29 18:06:58 2009 -0800 doc: nuke *.rbc files when generating docs RDoc likes them for some reason commit 16c0391066b38e5f3ea834b59632645890519574 Author: Eric Wong Date: Sun Nov 29 16:19:02 2009 -0800 preliminary NeverBlock support with EventMachine commit f050fcb9e5da4adf3b5b4f65c0590360113e78fd Author: Eric Wong Date: Sat Nov 28 18:36:47 2009 -0800 Allow options to be added to "use" Eventually we hope to be able to accept arguments like the way Rack handlers do it: use :Foo, :bool1, :bool2, :option => value commit 37a560c5d14c15a3da7f2c10c9ea3d6002b34fe1 Author: Eric Wong Date: Sat Nov 28 19:42:53 2009 -0800 refactor threaded models to use blocking accept() if possible It's a tad faster for non-keepalive connections and should do better on large SMP machines with many workers AND threads. That means the ActorSpawn model in Rubinius is nothing more than ThreadSpawn underneath (for now). commit 50fb5151bd44137adace51a0652f4d01d851790c Author: Eric Wong Date: Sat Nov 28 12:55:17 2009 -0800 doc: add ActorSpawn to comparison commit c0187f8978919df981806b5b9830873ec0e3f990 Author: Eric Wong Date: Sat Nov 28 12:51:59 2009 -0800 ActorSpawn sets rack.multithreaded :( I so wish it used Fibers/green-threads underneath instead. commit 53624699c89c4529651153325b7e47696abb9788 Author: Eric Wong Date: Sat Nov 28 12:42:31 2009 -0800 GNUmakefile: capitalize externally settable variables commit 57fdb562754cad478fc36af175d4815b313242fc Author: Eric Wong Date: Sat Nov 28 12:21:15 2009 -0800 tests: more stringent error checking in logs If we logged "ERROR", we should know about it. commit 3519c3ecbc7e39bf7d915ea48f19c51f8a6e638b Author: Eric Wong Date: Sat Nov 28 12:20:11 2009 -0800 tests: +x broken app test, fix config file setup commit f824f4e13a13daf56439e16ecb3a62469a8c9bf0 Author: Eric Wong Date: Sat Nov 28 11:43:45 2009 -0800 always set FD_CLOEXEC if available Some people fork processes, so it avoid hanging a connection open because of that... commit 2489368a624cff50a330238cf3c3f16eb0bd743c Author: Eric Wong Date: Sat Nov 28 11:26:39 2009 -0800 common Rainbows.accept method commit 6443cc4b87e3ba71ad661d795c3856f95a058a24 Author: Eric Wong Date: Sat Nov 28 00:25:46 2009 -0800 rev/core: fix stupid syntax error :< Broken in 145185b76dafebe5574e6a3eefd3276555c72016 commit 89dc5af4d59419e63a9d332fb4bdfa923205135e Author: Eric Wong Date: Sat Nov 28 00:16:18 2009 -0800 actor_spawn: basically ThreadSpawn with Actors for now... Rubinius Actor specs seem a bit lacking at the moment. If we find time, we'll fix them, otherwise we'll let somebody else do it. commit 3cc3c73959c0227ddc732699975a1edb1f0aa2d1 Author: Eric Wong Date: Fri Nov 27 17:59:28 2009 -0800 preliminary ActorSpawn model for Rubinius It seems to basically work, this is based heavily on the Revactor one... commit 48ff371c2021e477a1c57bb68dbeecaca21053de Author: Eric Wong Date: Fri Nov 27 17:27:05 2009 -0800 doc/comparison: apparently Rubinius doesn't do Fibers Guess I'll have to make the Revactor model work with that. commit 238fbf19bb736d3f95fc3c3e8cc8afaf29e4ce09 Author: Eric Wong Date: Fri Nov 27 17:04:51 2009 -0800 thread_spawn: fix up stupidly complicated loop Not sure what drugs the person that wrote it was on at the time. commit 145185b76dafebe5574e6a3eefd3276555c72016 Author: Eric Wong Date: Fri Nov 27 17:20:16 2009 -0800 rev/core: set IO::Buffer.default_node_size if possible It can noticeably improve performance if available. ref: http://rubyforge.org/pipermail/rev-talk/2009-November/000116.html commit 2dcde57f3ea10b916a9601eb139394a02bcede87 Author: Eric Wong Date: Fri Nov 27 10:26:19 2009 -0800 README: switch rubyforge.org git links to repo.or.cz We've long had the repo.or.cz mirrors and RubyForge may not support git any longer. commit 32b2b2a3669ba5b96d172acdcc6c8886609fff4d Author: Eric Wong Date: Fri Nov 27 10:21:43 2009 -0800 More documentation tweaks for the release commit abe9ce1e677b88c5b1f4f04ba9759d6c272b8563 Author: Eric Wong Date: Fri Nov 27 09:56:44 2009 -0800 rev_thread_spawn: more 1.8 notes commit f858b05bc895ae0ff5b602a829b364b176d8e072 Author: Eric Wong Date: Fri Nov 27 01:50:40 2009 -0800 local.mk.sample: respecting RUBYLIB breaks "full-test" Better just to edit my private local.mk when I'm testing with alternate versions of libraries... commit 6d81636901a6417e925c588d748a12634e8e5f82 Author: Eric Wong Date: Fri Nov 27 01:11:19 2009 -0800 tests: fix bugs with dash in GNUmakefile One bad thing to defaulting to ksh93 for my tests during development, small cleanups while we're at it, too for extra checks commit 399dc41b753d2bbc74e099ef0d33afbcddf82b99 Author: Eric Wong Date: Fri Nov 27 00:25:09 2009 -0800 tests: no need to limit t9000 in multiple places The test itself already exits immediately if it's running an incompatible concurrency model, so avoid having redundant logic in the GNUmakefile. commit 23921538a108ab7aeb5b2654b58101e15259238f Author: Eric Wong Date: Thu Nov 26 22:55:11 2009 -0800 RevThreadSpawn: hope for 1.8 performance Patches submitted to rev-talk, awaiting feedback and hopefully a new release. commit 921a961e91276522c134813052a7b7e06b00ef2b Author: Eric Wong Date: Thu Nov 26 21:38:06 2009 -0800 tests: enable AppPool test for Revactor and Fiber* commit bd2f88ff10203dd37749e451eaac70294a4a3e56 Author: Eric Wong Date: Thu Nov 26 21:23:51 2009 -0800 Fiber::Queue documentation While we're at it, ensure our encoding is sane commit e3d3f3be3dc41426d4715574d367e63ba185f177 Author: Eric Wong Date: Thu Nov 26 21:14:52 2009 -0800 split Fiber::Base into its own file While Revactor uses Fiber::Queue in AppPool, we don't want/need to expose the rest of our Fiber stuff to it since it can lead to lost Fibers if misused. This includes the Rainbows::Fiber.sleep method which only works inside Fiber{Spawn,Pool} models and the Rainbows::Fiber::IO wrapper class. commit ec28491f95eee2843a9ec1c8591114c567fcf2c5 Author: Eric Wong Date: Thu Nov 26 20:58:59 2009 -0800 local.mk.sample: allow RUBYLIB + RSYNC vars in CLI commit 53a3d5d6a7f5fcab0f5693fb28725275d5987f3a Author: Eric Wong Date: Thu Nov 26 19:24:21 2009 -0800 tests: "models" variable may be set in gmake CLI This lets us make further tests for compatibility without dirtying our working tree. commit 0f55590802718f3e59550ca5481895d9c4262f1a Author: Eric Wong Date: Thu Nov 26 17:44:39 2009 -0800 comparison: more updates notes commit 564d46615633a1da8a1be61be28f342ae2eb3b09 Author: Eric Wong Date: Thu Nov 26 17:32:52 2009 -0800 README: formatting and updates commit 4c546f593166b46bfd8ba0cf0da4b8ac6a05cd4d Author: Eric Wong Date: Thu Nov 26 17:26:35 2009 -0800 README: "an HTTP", not "a HTTP" (I think...) We need a professional editor. commit 45db7aa7e9f00301332b019e1c033c7239c46ba2 Author: Eric Wong Date: Thu Nov 26 14:58:41 2009 -0800 documentation publishing updates Don't show ChangeLog for unreleased things commit f67dadaf65a788c05ba8cd517204e85ee2c57130 Author: Eric Wong Date: Thu Nov 26 14:35:17 2009 -0800 TODO: add NeverBlock Not sure if the project is still alive, but it looks pretty cool. commit 5868eeecb2fbc85f3e4fabf3d16f27d259491c0d Author: Eric Wong Date: Thu Nov 26 14:09:45 2009 -0800 cleanup and refactor error handling Make sure app errors get logged correctly, and we no longer return a 500 response when a client EOFs the write end (but not the read end) of a connection. commit 278d9d5a7f3d2dc3c6563af1584b5e773e08073d Author: Eric Wong Date: Thu Nov 26 00:41:26 2009 -0800 Fiber*: cleanup scheduling, fix keepalive Both FiberSpawn and FiberPool share similar main loops, the only difference being the handling of connection acceptance. So move the scheduler into it's own function for consistency. We'll also correctly implement keepalive timeout so clients get disconnected at the right time. commit 1079dfa30108466d413f30526eda468cdf0ae985 Author: Eric Wong Date: Wed Nov 25 22:30:35 2009 -0800 Add Summary document This will hopefully make many things clearer about the project. commit dd2b2274ef0cd8a121cf7655ade939a1f63bc971 Author: Eric Wong Date: Wed Nov 25 19:01:34 2009 -0800 AppPool middleware now compatible with Fibers This enables the safe use of Rainbows::AppPool with all concurrency models, not just threaded ones. AppPool is now effective with *all* Fiber-based concurrency models including Revactor (and of course the new Fiber{Pool,Spawn} ones). commit 7f11b212f78a5070bea17bc20af43395b6cc621d Author: Eric Wong Date: Wed Nov 25 15:08:25 2009 -0800 Fiber*: add Rainbows::Fiber.sleep method It works exactly like Actor.sleep and similar to Kernel.sleep (no way to sleep indefinitely), but is compatible with the IO.select-based Fiber scheduler we run. This method only works within the context of a Rainbows! application dispatch. commit 06de4af18d1ba3b28e49e9d8f700df4eca36e635 Author: Eric Wong Date: Wed Nov 25 12:14:21 2009 -0800 Documentation updates for new concurrency models commit 7da8f7696fafc22a50dbcded6ca44cad7ae32ab6 Author: Eric Wong Date: Wed Nov 25 10:18:02 2009 -0800 add FiberPool concurrency model This is another Fiber-based concurrency model that can exploit a streaming "rack.input" for clients. Spawning Fibers seems pretty fast, but maybe there are apps that will benefit from this. commit 69b3f0f1627744926f53d13714ba62f0e83333c8 Author: Eric Wong Date: Wed Nov 25 09:11:18 2009 -0800 Gemcutter prep, fix RubyGems capitalization commit 4d8304bf0aa5665e8f8474dfb96019297fa0c2b9 Author: Eric Wong Date: Wed Nov 25 01:44:34 2009 -0800 add FiberSpawn concurrency model This one seems a easy to get working and supports everything we need to support from the server perspective. Apps will need modified drivers, but it doesn't seem too hard to add more/better support for wrapping IO objects with Fiber::IO. commit 2bc6e7a3c4e972ee3227d931e79bc4057ba278ca Author: Eric Wong Date: Tue Nov 24 22:52:35 2009 -0800 Rev*: safer client accounting Due to the addition of keepalive_timeouts, it's safer to pay a performance penalty and use a hash here instead. commit cf504b527fa8ca2b612db1d7967a76536dc8347f Author: Eric Wong Date: Tue Nov 24 22:52:00 2009 -0800 fix grammar fail in RDoc commit 24248e78de684fbac374be216892a0b4050a1693 Author: Eric Wong Date: Tue Nov 24 01:50:26 2009 -0800 rework RevThreadSpawn without TeeInput and 1.8 support Exposing a synchronous interface is too complicated for too little gain. Given the following factors: * basic ThreadSpawn performs admirably under REE 1.8 * both ThreadSpawn and Revactor work well under 1.9 * few applications/requests actually need a streaming "rack.input" We've decided its not worth the effort to attempt to support streaming rack.input at the moment. Instead, the new RevThreadSpawn model performs much better for most applications under Ruby 1.9 commit 9cc509bda610fa5ca8c642cdcf480835b8dfc468 Author: Eric Wong Date: Tue Nov 24 01:12:16 2009 -0800 rev/event_machine: avoid needless rewinds No point in rewinding the NULL_IO especially when most requests use them instead of bodies that actually have something. commit 77f930cb64d32b3fac942b462cf4c7a04af730e3 Author: Eric Wong Date: Wed Nov 18 00:08:52 2009 -0800 make keepalive_timeout configurable And change the default to 2 seconds, most clients can render the page and load all URLs within 2 seconds. commit 02245b9ea8a407ac67a9633119140fa2fd2c561e Author: Eric Wong Date: Wed Nov 18 00:08:26 2009 -0800 EventMachine: implement keepalive timeout Fortunately it's easy here. commit 9ab648f027d25b90fb2e7011fcd92091f19e7b02 Author: Eric Wong Date: Wed Nov 18 00:08:23 2009 -0800 rev: implement keepalive timeout This is a bit trickier than the rest since we have to ensure deferred (proxied) responses aren't nuked. commit c71773184633402e2a47ea6c3bc6be639cddc744 Author: Eric Wong Date: Wed Nov 18 00:08:21 2009 -0800 Thread*: start implementing keepalive timeout If the Revactor implementation using lightweight Actors/Fibers needs it, then thread implementations do, too. commit fc931be708f8da823a484fe88da9251d9cc72949 Author: Eric Wong Date: Wed Nov 18 00:08:20 2009 -0800 revactor: :timeout for reading headers in TCP sockets We'll be getting a keepalive_timeout setting soon, clients with 300 second idle keepalives are ridiculous and Ruby objects are still not that cheap in 1.9