about summary refs log tree commit homepage
path: root/lib/rainbows.rb
DateCommit message (Collapse)
2011-05-16doc: cleanup rdoc for Rainbows module
The only supported method is Rainbows.sleep in here
2011-05-16more reliable shutdown for epoll concurrency models
Just close the epoll descriptor, since the sleepy_penguin epoll_wait wrapper may not return EINTR in the future.
2011-05-10configurator: move validation logic over
There's actually no reason we can't have these methods in Rainbows::Configurator where it's easier to document nowadays.
2011-05-09split out pool_size module
coolio_thread_pool, neverblock both use it, and xepoll_thread_pool will support it next, too.
2011-05-09add XEpollThreadPool concurrency option
This is probably friendlier on server resources in the worst case than XEpollThreadSpawn but may perform worse in the client client-visible way, too.
2011-05-06ensure some requires get loaded in master
More sharing, faster startups, and most importantly, better error reporting if some things are missing.
2011-05-03Rainbows! defaults more DRY
We won't forget to reset defaults on SIGHUP anymore.
2011-05-03s/max_bytes/client_max_body_size/ for consistency
Too confusing otherwise...
2011-05-03add client_header_buffer_size tuning parameter
We're changing our default to 1K buffers to save memory. This should reduce memory usage of idle clients and lower pressure on the MRI GC. Rails applications using session cookies (the default) may want to up this to 2K or more.
2011-05-02rainbows: get rid of MODEL_WORKER_CONNECTIONS constant
Just use regular autoload, now. Less guesswork.
2011-04-29xepoll_thread_spawn: initial implementation
Whee! This is going to be awesome.
2011-04-25make all concurrency options use 50 by default
This may change again in the future, but it paves the way for simplifying this code...
2011-03-21simplify LISTENERS closing
No need to obfuscate what it's doing
2011-02-05*epoll: refactor common loop code
acceptor thread pools could use some work, still
2011-02-05less expensive QUIT processing
Avoid constantly nuking the method cache and raising repeated exceptions while our master process is shutting us down.
2011-02-04rename XAcceptEpoll to XEpoll
It's too long especially since XEpollThreadPool is planned :>
2011-02-04test_isolate: use latest Unicorn
It supports IPv6 and pulls in a better Kgio. Since Unicorn defaults to ":tcp_nopush => true", we need to flip it back to false to be compatible with the types of apps Rainbows! is targetted as.
2011-02-01preliminary reverse proxy Rack application
This can be a starting point for developing Cool.io or EventMachine-based reverse proxy applications on Rainbows! Eventually Rainbows! could replace nginx for Unicorn users! Just don't consider this code production ready, yet, at all, it doesn't handle any sort of failover and has no automated tests, yet.
2011-01-24initial XAcceptEpoll concurrency model
Edge-triggered epoll concurrency model with blocking accept() in a (hopefully) native thread. This is recommended over Epoll for Ruby 1.9 users as it can workaround accept()-scalability issues on multicore machines.
2011-01-24clear LISTENERS array on close
No reason to keep it around
2011-01-20merge rack_input into process_client
It turns out to be less-used than previous anticipated, so there's no point in having yet another module.
2011-01-20remove unused 416 error constants/exceptions
We handle that locally in rainbows/response now
2011-01-19initial edge-triggered epoll model
Coolio and EventMachine only use level-triggered epoll, but being Rainbows!, we live on the EDGE!
2011-01-06minor cleanups following state cleanups
We noticed a few more things that could be cleaned up after the last commit.
2011-01-06eliminate G constant and just use the Rainbows! module
Code organization is hard :<
2011-01-06rainbows.rb: unindent
2011-01-06eliminate timed_read module
No need to split it out when there's only a single class using it.
2011-01-06simplify keepalive_timeout accounting
Easier just to use an instance variable
2011-01-05disable Nagle's algorithm by default
Nagle's algorithm is harmful with the write-write-read sequence during keepalive, so we disable it performance for users using keepalive. We always write headers with a separate write because Rack response bodies may not always be ready for writing when headers are. This requires Unicorn 3.3.0
2011-01-05simplify Rainbows.max_bytes implementation
Yes, I'm still learning Ruby.
2011-01-04globally refactor Range handling for responses
Rack::Utils::HeaderHash is still very expensive in Rack 1.2, especially for simple things that we want to run as fast as possible with minimal interference. HeaderHash is unnecessary for most requests that do not send Content-Range in responses.
2011-01-04simplify per-client keepalive state checks
This lets us simplify repetitive checks worry less about properly maintaining/closing client connections for each concurrency model we support.
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-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-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_*: split out common socket_proxy code
Needless duplication sucks
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-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).
2010-10-23http_request: remove this (sub)class
It does not appear to be needed, for now, since the parser and Unicorn::HttpRequest are one and the same.
2010-10-22unindent most files
This simplifies and disambiguates most constant resolution issues as well as lowering our identation level. Hopefully this makes code easier to understand.
2010-10-22code shuffling for kgio
Despite the large number of changes, most of it is code movement here.
2010-10-21unicorn 2.x updates + kgio
We get basic internal API changes from Unicorn, code simplifications coming next.
2010-09-28start using kgio library
It removes the burden of byte slicing and setting file descriptor flags. In some cases, we can remove unnecessary peeraddr calls, too.
2010-08-26split out accept() callers to acceptor module
Trying to avoid adding singleton methods since it's too easily accessible by the public and not needed by the general public. This also allows us (or just Zbatery) to more easily add support systems without FD_CLOEXEC or fcntl, and also to optimize away a fcntl call for systems that inherit FD_CLOEXEC.
2010-08-19add Rainbows::ThreadTimeout middleware
This allows for per-dispatch timeouts similar to (but not exactly) the way Mongrel (1.1.x) implemented them with threads.
2010-08-17avoid EBADF with certain middlewares when proxying
First off we use an FD_MAP to avoid creating redundant IO objects which map to the same FD. When that doesn't work, we'll fall back to trapping Errno::EBADF and IOError where appropriate.
2010-08-03doc: hide internal Response416 error constant
It's an internal implementation detail and not for user consumption.
2010-07-22enable Range: responses for static files for most models
The FileStreamer class of EventMachine (and by extension NeverBlock) unfortunately doesn't handle this. It's possible to do with Revactor (since it uses Rev under the covers), but we'll support what we can easily for now.
2010-07-20rely on autoload for Base and TeeInput
Its conceivable that we can avoid loading TeeInput for EventMachine and Rev concurrency models in the future since it's unused there.