Date | Commit message (Collapse) |
|
This removes the extra per-process file descriptor and
replaces it with Raindrops.
|
|
We can get away with a single stack frame reduction. Unicorn
itself has more stack reductions, but Rainbows! is further
behind in this area.
|
|
This doesn't use Rainbows::Base so we have no keepalive support
at all. This could eventually be an option for streaming
applications.
|
|
The only supported method is Rainbows.sleep in here
|
|
Just close the epoll descriptor, since the sleepy_penguin
epoll_wait wrapper may not return EINTR in the future.
|
|
There's actually no reason we can't have these methods
in Rainbows::Configurator where it's easier to document
nowadays.
|
|
coolio_thread_pool, neverblock both use it, and
xepoll_thread_pool will support it next, too.
|
|
This is probably friendlier on server resources in the worst
case than XEpollThreadSpawn but may perform worse in the client
client-visible way, too.
|
|
More sharing, faster startups, and most importantly,
better error reporting if some things are missing.
|
|
We won't forget to reset defaults on SIGHUP anymore.
|
|
Too confusing otherwise...
|
|
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.
|
|
Just use regular autoload, now. Less guesswork.
|
|
Whee! This is going to be awesome.
|
|
This may change again in the future, but it
paves the way for simplifying this code...
|
|
No need to obfuscate what it's doing
|
|
acceptor thread pools could use some work, still
|
|
Avoid constantly nuking the method cache and raising
repeated exceptions while our master process is shutting
us down.
|
|
It's too long especially since XEpollThreadPool is planned :>
|
|
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.
|
|
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.
|
|
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.
|
|
No reason to keep it around
|
|
It turns out to be less-used than previous anticipated,
so there's no point in having yet another module.
|
|
We handle that locally in rainbows/response now
|
|
Coolio and EventMachine only use level-triggered epoll,
but being Rainbows!, we live on the EDGE!
|
|
We noticed a few more things that could be cleaned
up after the last commit.
|
|
Code organization is hard :<
|
|
|
|
No need to split it out when there's only a single
class using it.
|
|
Easier just to use an instance variable
|
|
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
|
|
Yes, I'm still learning Ruby.
|
|
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.
|
|
This lets us simplify repetitive checks worry less about
properly maintaining/closing client connections for each
concurrency model we support.
|
|
We use Cool.io internally everywhere now, but preserve
Rev-based models for anybody using them.
|
|
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.
|
|
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.
|
|
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.
|
|
Needless duplication sucks
|
|
One line of code saved! We'll also avoid loading
DeferredChunkResponse which is rarely needed
(unlike DeferredResponse).
|
|
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).
|
|
It does not appear to be needed, for now, since the
parser and Unicorn::HttpRequest are one and the same.
|
|
This simplifies and disambiguates most constant resolution
issues as well as lowering our identation level. Hopefully
this makes code easier to understand.
|
|
Despite the large number of changes, most of it is code
movement here.
|
|
We get basic internal API changes from Unicorn,
code simplifications coming next.
|
|
It removes the burden of byte slicing and setting file
descriptor flags. In some cases, we can remove unnecessary
peeraddr calls, too.
|
|
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.
|
|
This allows for per-dispatch timeouts similar to (but not exactly)
the way Mongrel (1.1.x) implemented them with threads.
|
|
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.
|