about summary refs log tree commit homepage
path: root/lib
DateCommit message (Collapse)
2010-12-29Rainbows! 2.1.0 - Cool.io, bugfixes and more! v2.1.0
Cool.io (new version of Rev) support is explicitly added (it always worked before). ":Coolio" may be used in place of ":Rev" anywhere in your Rainbows! config file. There is a new "keepalive_requests" config directive to limit the number of requests a single connection may make (default: 100, same as nginx). This may be useful for better load-balancing characteristics. The old "Rev" prefixes remain supported as long as Cool.io remains compatible with Rev (likely forever). Bug fixes: * Rainbows::ThreadTimeout middleware with multiple clients * large, pipelined upload errors with Revactor+Coolio(Rev) * high CPU usage for maintaining idle keepalive on *Fiber* * needless ThreadPool wakeups * request env prematurely cleared keepalive requests, breaking some middlewares such as Clogger. * "close" not called on body if wrapper and sendfile used together Various code cleanups, and our RDoc website is JavaScript-free. See the ChangeLog or git for all changes.
2010-12-28complete Rev => Coolio renaming
We use Cool.io internally everywhere now, but preserve Rev-based models for anybody using them.
2010-12-28several response body#close fixes
Some middlewares require the Rack env to be preserved all the way through to close, so we'll ensure all request models preserve it. We also need to better response body wrappers/proxies always get fired properly when returning. IO.copy_stream and "sendfile" gem users could hit cases where wrappers did not fire properly.
2010-12-28dev_fd_response: pass files straight through
No need to wrap regular files
2010-12-28enable the keepalive_requests config option
This will allow servers to limit the number of keepalive requests that can be made over a single connection to prevent denial-of-service and also to improve fairness in load-balancing.
2010-12-27coolio*: favor Coolio over Rev
We still use and define Rev internally, but that's mostly just manual labor of converting stuff over.
2010-12-27coolio_fiber_spawn: decrease CPU usage for keepalive
Blindly resuming fibers every second is a waste of cycles, we can use the ZZ hash in regular FiberSpawn to resume expired fibers on an as-needed basis. While we're at it, merge the keepalive-timeout class into the heartbeat, there's no reason to have separate timers and classes here.
2010-12-27doc: misc cleanups and additions for RDoc
This is also our website, so we need to document the new Cool.io-based concurrency options for users and point existing Rev* users to it.
2010-12-27initial cool.io support
Cool.io is the new name for Rev. We'll continue to support Rev until Cool.io breaks backwards compatibility. Rev may not be supported if Cool.io is.
2010-12-27fiber/io: avoid allocating Range objects for slicing
It's slightly faster this way, but string slicing sucks anyways :<
2010-12-27fiber/*: more efficient keepalive_timeout expiry
We can use the same interface as Rainbows::Fiber.sleep to avoid blindly waking up readers at ever scheduler invocation.
2010-12-27fiber/base: use bare "select" where possible
Less visual noise
2010-12-27thread_pool: avoid needless wakeups from select
No point in waking up when our ticker runs in a separate thread.
2010-12-27thread_*: unindent
Hopefully this will make our code easier to follow.
2010-12-27introduce worker_yield method
This lets Rainbows! yield the current worker process when busy in the hopes another worker will pick up the slack. We can also override this for the single worker process case later if people care enough.
2010-12-27writer_thread_spawn: factor out Client.quit
Self-documenting code is easier to follow
2010-12-27writer_thread_*: split out classes into separate files
Use a consistent "Client" naming to reduce confusion
2010-12-27writer_thread_*: split out common socket_proxy code
Needless duplication sucks
2010-12-27writer_thread_*: unindent
2010-12-27revactor: split out tee_socket and use autoload
Some applications never need TeeSocket, and we don't have to worry about thread-safety with Revactor.
2010-12-26more :: prefix elimination
This should make things easier on the eyes.
2010-12-26fiber/queue: unindent
This also cleans up some constant resolution for the root Fiber class.
2010-12-26remove unnecessary "::" constant prefixing
It's ugly to look at.
2010-12-26never_block: simplify and split out code
alias_method is a mess, super is superb!
2010-12-26event_machine: split out server and client classes
This should make things easier to find
2010-12-26rev_thread_*: unindent and split out
This should make classes easier to find and hopefully make our code easier to follow.
2010-12-26rainbows/rev/* require/autoload cleanup
One line of code saved! We'll also avoid loading DeferredChunkResponse which is rarely needed (unlike DeferredResponse).
2010-12-26rename rev/thread => rev/thread_client
While we're at it, unindent
2010-12-26rev_thread_spawn: disable under Ruby 1.8
It still burns CPU at the first sign of doing anything interesting, so stop it. Ruby 1.9 is the future :P
2010-12-26avoid HttpParser#keepalive? and HttpParser#reset
The HttpParser#next? method will come with keepalive protection for Rainbows!, which can prevent clients from monopolizing a server with excessive pipelining/keepalive requests.
2010-12-26rainbows/rev/*: uninident some more
This makes constant resolution more predictable, we hope.
2010-12-26rev: split out Rainbows::Rev::Server
One file per class/module should be easier for new hackers to find. Unindent rainbows/rev/core while we're at it, too.
2010-12-26rev: unindent, needless autoload
Deferred* classes will get loaded anyways since Rainbows::Rev::Client hit them in case statements.
2010-12-20thread_timeout: fix bad comparison
This was causing unrelated requests to get killed every +timeout+ seconds, instead of only the ones that were running too long. Noticed-by: ghazel@gmail.com ref: http://mid.gmane.org/AANLkTi=7OhyTwkHsp_rXU7Gp1PokihiQ9bJigpO-BfN6@mail.gmail.com
2010-12-20thread_timeout: avoid a threading bug under 1.9
Because of the lack of GVL-releasing syscalls in this branch of the thread loop, we need Thread.pass to ensure other threads get scheduled appropriately under 1.9. This is likely a threading bug in 1.9 that warrants further investigation when we're in a better mood.
2010-12-09respect client_body_buffer_size in Unicorn 3.1.0
This is only needed for concurrency options that do not use TeeInput, since TeeInput automatically handles this for us.
2010-12-09thread_timeout: de-Struct-ify
Avoid exposing internals, it's also slightly faster to access ivars directly rather than using method calls.
2010-12-08respect "rewindable_input false" in Unicorn config
This was completely overlooked for the Rainbows 2.0.x releases.
2010-12-08rev+revactor: fix LARGE pipelined uploads
Large uploads behave differently with regard to buffering, and there were bugs in the way the Rev and Revactor backends handled uploads.
2010-12-03Rainbows! 2.0.1 - upload pipelining fixes v2.0.1
For HTTP clients living on the edge and pipelining uploads, we now fully support pipelined requests (as long as the application consumes each request in its entirety).
2010-12-03fix pipelining of requests with bodies
All synchronous models have this fixed in unicorn 3.0.1, so only Rev and EventMachine-based concurrency models require code changes.
2010-12-02ev_core: refactor and split cap_input out
Hopefully it makes more sense now and is easier to digest for new hackers.
2010-12-01ev_core: split out prepare_request_body
We may have other uses for this in the future...
2010-11-20Rainbows! 2.0.0 - minority rules! v2.0.0
This release is targeted at the minority of web applications that deal heavily with uploads. Thanks to Unicorn 3.x, we now support HTTP keepalive for requests with bodies as long as the application consumes them. Unicorn 3.x also allows disabling the rewindability requirement of "rack.input" (in violation of the Rack 1.x spec). The global client_body_max_size may also be applied per-endpoint using the Rainbows::MaxBody middleware described in: http://rainbows.rubyforge.org/Rainbows/MaxBody.html
2010-11-19revactor: fix braindamaged commit/coding style
Oops, last commit was rushed
2010-11-19simpler keepalive check for synchronous models
Unicorn 3.x includes HttpParser#next? which will reset the parser for keepalive requests without extra steps.
2010-11-19max_body: rewrite wrappers to be safer
To avoid denial-of-service attacks, the wrappers need to intercept requests *before* they hit the memory allocator, so we need to reimplement the read(all) and gets cases to use smaller buffers whenever the application does not specify one.
2010-11-19max_body: do not enable for RevThread* models
Those already use CapInput, just like the rest of the evented Rainbows! world.
2010-11-19upgrade to Kgio 2.x and Unicorn 3.x
Kgio 2.0.0 has a superior API and less likely to conflict or blow up with other applications. Unicorn 3.x requires Kgio 2.x, too.
2010-11-16reimplement client_max_body_size handlers
This allows the client_max_body_size implementation to not rely on Unicorn::TeeInput internals, allowing it to be used with Unicorn::StreamInput (or any other (nearly) Rack::Lint-compatible input object).