about summary refs log tree commit homepage
path: root/lib/rainbows/http_server.rb
DateCommit message (Collapse)
2011-05-16use :pool_size for RLIMIT_NPROC with thread pool models
Only needed for Ruby 1.9
2011-05-16add "copy_stream" config directive
This allows using IO::Splice.copy_stream from the "io_splice" RubyGem on recent Linux systems. This also allows users to disable copy_stream usage entirely and use traditional response_body.each calls which are compatible with all Rack servers (to workaround bugs in IO.copy_stream under 1.9.2-p180).
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-05http_server: XEpollThreadSpawn sets RLIMIT_NPROC
It *can* have as many threads as it does idle connections.
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-02http_server: default all options to 50 connections
pavinging the way for changing MODEL_WORKER_CONNECTIONS
2011-04-21increase RLIMIT_NPROC for thread-crazy folks
Might as well, threads are free and cheap on 64-bit
2011-04-21http_server: attempt to increase RLIMIT_NOFILE
In case people try to do C10K, make life easier for them.
2011-04-19http_server: less hacky loading of concurrency model
Ugh the old way was gross.
2011-03-20fix various warnings with "check-warnings" target
Run under 1.9.3dev
2011-02-07fix optional "use" argument handling
Actually use the Rainbows::O constant for use [ew: rewritten commit message subject] Acked-by: Eric Wong <normalperson@yhbt.net>
2011-02-05http_server: kill a warning
Ugh, I need to think of a way to clean this up...
2011-02-04rename XAcceptEpoll to XEpoll
It's too long especially since XEpollThreadPool is planned :>
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-19initial edge-triggered epoll model
Coolio and EventMachine only use level-triggered epoll, but being Rainbows!, we live on the EDGE!
2011-01-06eliminate G constant and just use the Rainbows! module
Code organization is hard :<
2011-01-06simplify keepalive_timeout accounting
Easier just to use an instance variable
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-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-10-28HUP reload restores defaults on unset settings
For consistency, changed settings are reset back to their default values if they are removed or commented out from the config file.
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-21unicorn 2.x updates + kgio
We get basic internal API changes from Unicorn, code simplifications coming next.
2010-10-21http_server: more descriptive error for debugging
Sometimes we have stupid syntax or constant resolution errors in our code.
2010-07-10doc: avoid documenting internals on RDoc website
Since we suck at building websites, we just rely on RDoc as a website builder. And since Rainbows! is an application server (and not a programming library), our internal API should be of little interest to end users. Anybody interested in Rainbows! (or any other project) internals should be reading the source.
2010-06-18prefer Array#[] lookup to Array#first/Array#last
Array#[] lookups are slightly faster under both rbx and 1.9, and easier to read.
2010-06-09http_server: use super instead of alias_method
duh!
2010-05-04drop EventMachineDefer concurrency model
Since we have conditional deferred execution in the regular EventMachine concurrency model, we can drop this one. This concurrency model never fully worked due to lack of graceful shut downs, and was never promoted nor supported, either.
2010-05-03add client_max_body_size config directive
Since Rainbows! is supported when exposed directly to the Internet, administrators may want to limit the amount of data a user may upload in a single request body to prevent a denial-of-service via disk space exhaustion. This amount may be specified in bytes, the default limit being 1024*1024 bytes (1 megabyte). To override this default, a user may specify `client_max_body_size' in the Rainbows! block of their server config file: Rainbows! do client_max_body_size 10 * 1024 * 1024 end Clients that exceed the limit will get a "413 Request Entity Too Large" response if the request body is too large and the connection will close. For chunked requests, we have no choice but to interrupt during the client upload since we have no prior knowledge of the request body size.
2010-04-02rainbows/http_*: remove unnecessary circular requires
http_response and http_server are never NOT loaded when "rainbows" is required.
2009-12-08EventMachineDefer: preliminary (and) broken version
There's a good chunk of tests that fail with this, still. Worse, I haven't been able to figure out what's wrong since it looks like it would involve looking at C++ code...
2009-11-29preliminary NeverBlock support with EventMachine
2009-11-29Allow 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
2009-11-18make keepalive_timeout configurable
And change the default to 2 seconds, most clients can render the page and load all URLs within 2 seconds.
2009-11-15Revert "Threaded models have trouble with late loading under 1.9"
This reverts commit e1dcadef6ca242e36e99aab19e3e040bf01070f9. This is fixed separately in Unicorn 0.95.0 (commit 560216c2fecfc5cf3489f749dc7a0221fd78eb26)
2009-11-13gracefully exit workers if reopening logs fails
Permissions for the logs could've been badly set by the master. So we we'll let the master reopen them and refork children to get around this problem. We have to be more careful when reopening logs because we can reopen them in the middle of client requests (we have to) whereas Unicorn has the luxury of _knowing_ it has no active clients when it does the reopen.
2009-11-07remove unnecessary class variable
It's already global...
2009-11-05Threaded models have trouble with late loading under 1.9
Loading TeeInput or HttpResponse late does not always work well in multithreaded situations and have been causing random test failures on heavily loaded multicore boxes.
2009-11-04http_server: add one second to any requested timeout
This is because our timeout implementations are less precise than Unicorn. Since we handle multiple clients with the same process, we sacrifice precision for performance and instead implement our fchmod heartbeats at a fixed rate, as doing fchmod() repeated for short-lived connections would hurt performance and we have to call fchmod even when connected clients are idle.
2009-11-02Allow 'use "model"' as a string as well as symbol
Since const_get works with a string as well as a symbol, allow that to be used. It's easier and simpler to just allow strings as use arguments than to error check and raise exceptions. So both of the following should now work: Rainbows! do use :Revactor end Rainbows! do use "Revactor" end Rainbows! will always use the symbol variant internally, however, so applications can alway expect env['rainbows.model'] to be a symbol.
2009-10-26eventmachine 0.12.8 passes all tests
This means Rainbows::DevFdBody async responses and large file streaming without slurping. This is only with eventmachine 0.12.8, it looks like 0.12.10 changes the attach/watch API...
2009-10-18rev: async response bodies with DevFdResponse middleware
This new middleware should be a no-op for non-Rev concurrency models (or by explicitly setting env['rainbows.autochunk'] to false). Setting env['rainbows.autochunk'] to true (the default when Rev is used) allows (e)poll-able IO objects (sockets, pipes) to be sent asynchronously after app.call(env) returns. This also has a fortunate side effect of introducing a code path which allows large, static files to be sent without slurping them into a Rev IO::Buffer, too. This new change works even without the DevFdResponse middleware, so you won't have to reconfigure your app. This lets us epoll on response bodies that come in from a pipe or even a socket and send them either straight through or with chunked encoding.
2009-10-17DRY setting of rack.multithread
It's more fool-proof this way and prevents us from using idiotic/non-obvious concurrency model names.
2009-10-14rack: expose "rainbows.model" in Rack environment
This allows applications to determine which concurrency model they're running under and possibly make adjustments accordingly. The standard "rack.multithread" isn't enough for some applications to determine what to do, especially when reentrancy is required/recommended.
2009-10-04vary defaults for worker_connections
Various concurrency models work and scale differently, pick counts that make a reasonable amount of sense...
2009-10-04configuration default tweaks
:Base is default (along with the implied worker_connections=1). This disallows nil for worker_connections, and makes.
2009-10-03remove Configurator and use Rainbows! block
This allows the server to be configured by doing something like this inside an existing Unicorn configuration file: Rainbows! do use :Revactor worker_connections 50 end This should make it obvious we're using Rainbows-only features.
2009-10-03http_server: simplify use=
I didn't remember extend when this was originally implemented.
2009-10-02initial revision
No tests yet, but the old "gossamer" and "rainbows" branches seem to be basically working.