rainbows.git
11 years agofiber/base: avoid negative sleep interval
Eric Wong [Fri, 24 Aug 2012 23:03:17 +0000 (24 23:03 +0000)]
fiber/base: avoid negative sleep interval

Also clarify the code while we're at it.
Thanks to Lin Jen-Shin for pointing this out.

ref: http://mid.gmane.org/CAA2_N1unOXb7Z4Jr8oKoSLu266O9Ko4o=oWzAcMA1w3=9X74KA@mail.gmail.com

11 years agoRakefile: freshmeat.net -> freecode.com
Eric Wong [Sat, 18 Aug 2012 08:10:14 +0000 (18 08:10 +0000)]
Rakefile: freshmeat.net -> freecode.com

freecode.com now requires HTTPS, too.

11 years agoRainbows! 4.4.0 - minor improvementsv4.4.0
Eric Wong [Sat, 18 Aug 2012 07:04:11 +0000 (18 07:04 +0000)]
Rainbows! 4.4.0 - minor improvements

For epoll/Cool.io-based concurrency models, shutdown() is now
used to timeout keepalive clients to avoid race conditions.
Minor documentation improvements.

11 years agothread_timeout: document additional caveats
Eric Wong [Thu, 19 Jul 2012 20:10:37 +0000 (19 13:10 -0700)]
thread_timeout: document additional caveats

Again, for the one thousandth time, timing out threads is very
tricky business :<

11 years agotest_isolate: bump raindrops dependency
Eric Wong [Sun, 1 Jul 2012 03:56:39 +0000 (1 03:56 +0000)]
test_isolate: bump raindrops dependency

As usual, test with the latest released version to avoid
surprises.

11 years agocoolio+xepoll_thread*: use shutdown() for keepalive timeout
Eric Wong [Sat, 30 Jun 2012 19:57:08 +0000 (30 19:57 +0000)]
coolio+xepoll_thread*: use shutdown() for keepalive timeout

Triggering Errno::EBADF is tricky in multithreaded situations
due to possible race conditions and yet-to-be discovered bugs.
shutdown(2) is also safe against apps the fork() internally but
do not execve(2) nor set FD_CLOEXEC.

n.b. calling fork() after pthreads are spawned may not be safe
on all platforms w.r.t. malloc, but /is/ the case for glibc on
GNU/Linux.

Follow-up-to: commit a5b987619f4b793203f6a50e424fe98c5b0794ba

11 years agoepoll*: favor shutdown(2) for keepalive timeout
Eric Wong [Mon, 18 Jun 2012 20:32:39 +0000 (18 20:32 +0000)]
epoll*: favor shutdown(2) for keepalive timeout

Triggering Errno::EBADF is tricky in multithreaded situations
due to possible race conditions and yet-to-be discovered bugs.
shutdown(2) is also safe against apps the fork() internally but
do not execve(2) nor set FD_CLOEXEC.

n.b. calling fork() after pthreads are spawned may not be safe
on all platforms w.r.t. malloc, but /is/ the case for glibc on
GNU/Linux.

11 years agofiber_pool: take Fibers from larger pools faster
Eric Wong [Wed, 9 May 2012 21:11:39 +0000 (9 21:11 +0000)]
fiber_pool: take Fibers from larger pools faster

Array#pop can be significantly faster than Array#shift on large
arrays (especially since we push into the Array).  This is
because Array#shift needs to shift all elements in the array,
and Array#pop only needs to shorten the array by one element.
The Fiber stack may also be hotter in CPU caches when we choose
the most-frequently used stack.

11 years agotest_isolate: update deps for EM tests
Eric Wong [Wed, 9 May 2012 21:11:13 +0000 (9 21:11 +0000)]
test_isolate: update deps for EM tests

async_sinatra and rack-fiber_pool had new versions since
we last updated.

11 years agotest_isolate: bump unicorn and kgio versions for testing
Eric Wong [Wed, 9 May 2012 02:20:42 +0000 (9 02:20 +0000)]
test_isolate: bump unicorn and kgio versions for testing

Users will pull the latest upstream, ensure things keep
working.

11 years agostream_response_epoll: fix for unicorn 4.3.x
Eric Wong [Wed, 9 May 2012 02:18:08 +0000 (9 02:18 +0000)]
stream_response_epoll: fix for unicorn 4.3.x

unicorn 4.3.x now calls shutdown() explicitly on the socket,
so we can't just rely on a dup()-ed FD to keep a socket around.

11 years agotests: require sleepy_penguin 3.1.0 or later
Eric Wong [Tue, 8 May 2012 23:18:41 +0000 (8 23:18 +0000)]
tests: require sleepy_penguin 3.1.0 or later

We'll be making the XEpollThreadPool users depend on this, too.

12 years agodoc: some spelling fixes
Eric Wong [Wed, 11 Apr 2012 21:48:36 +0000 (11 21:48 +0000)]
doc: some spelling fixes

Found with rdoc-spellcheck

12 years agot/test_isolate: update test dependencies
Eric Wong [Thu, 23 Feb 2012 08:07:13 +0000 (23 08:07 +0000)]
t/test_isolate: update test dependencies

At least for the gems I'm most familiar with...

12 years agot0501: fix ambiguous shell construct for capture + subshells
Eric Wong [Wed, 12 Oct 2011 23:29:23 +0000 (12 16:29 -0700)]
t0501: fix ambiguous shell construct for capture + subshells

Starting with "$((" can be ambiguous and confused for shell arithmetic.

12 years agohttp_server: fix log message if using Base (no concurrency)
Eric Wong [Wed, 12 Oct 2011 23:14:49 +0000 (12 16:14 -0700)]
http_server: fix log message if using Base (no concurrency)

Telling the user worker_connections=50 when using the Base
concurrency model is misleading.

12 years agoRainbows! 4.3.1 - small bugfixv4.3.1
Eric Wong [Fri, 2 Sep 2011 02:14:03 +0000 (2 02:14 +0000)]
Rainbows! 4.3.1 - small bugfix

This release fixes a potential reentrancy deadlock when
using the default logger from the Ruby standard library.

12 years agoavoid potential Logger deadlock in SIGQUIT and SIGUSR1
Eric Wong [Tue, 30 Aug 2011 23:18:21 +0000 (30 16:18 -0700)]
avoid potential Logger deadlock in SIGQUIT and SIGUSR1

If any combination of SIGQUIT and SIGUSR1 are sent to a
Rainbows! worker in a /very/ short period of time, the Mutex
used by the default Logger implementation may deadlock since
Mutex synchronization is not reentrant-safe.

Users of alternative logger implementations (or monkey-patched
ones) are possibly not affected.  Users of the logger_mp_safe.rb
monkey-patch distributed[1] with unicorn are not affected.

[1] http://unicorn.bogomips.org/examples/logger_mp_safe.rb

12 years agoRainbows! 4.3.0 - pull in changes from unicorn 4.1.0v4.3.0
Eric Wong [Sat, 20 Aug 2011 01:15:30 +0000 (20 01:15 +0000)]
Rainbows! 4.3.0 - pull in changes from unicorn 4.1.0

The deprecated Rainbows::HttpResponse class is finally gone
thanks to Pratik Naik.  Logging of errors is more consistent
with the changes in unicorn 4.1.0.  There are also minor
documentation updates.  See the unicorn 4.1.0 release notes
for more details:
  http://bogomips.org/unicorn.git/tag/?id=v4.1.0

12 years agobump unicorn dependency version
Eric Wong [Sat, 20 Aug 2011 00:55:56 +0000 (20 00:55 +0000)]
bump unicorn dependency version

We want the stricter parser the error log filtering in
unicorn 4.1.0

12 years agoTODO: remove splice(2) item
Eric Wong [Sat, 20 Aug 2011 00:50:52 +0000 (20 00:50 +0000)]
TODO: remove splice(2) item

Rainbows! 3.3.0 added the copy_stream Configurator directive

12 years agordoc: cleanup and stop depending on :enddoc:
Eric Wong [Sat, 20 Aug 2011 00:46:28 +0000 (20 00:46 +0000)]
rdoc: cleanup and stop depending on :enddoc:

It doesn't seem to work at the top of the file...

12 years agoupdate development wrongdoc dep to 1.6
Eric Wong [Sat, 20 Aug 2011 00:37:03 +0000 (20 00:37 +0000)]
update development wrongdoc dep to 1.6

Hopefully this points more folks to email us.

12 years agoevent_machine: update rdoc for new Cramp homepage
Eric Wong [Fri, 19 Aug 2011 23:13:10 +0000 (19 23:13 +0000)]
event_machine: update rdoc for new Cramp homepage

Cramp has a homepage and mailing list now, yay!

12 years agocramp: update test dependency to version to 0.15
Eric Wong [Fri, 19 Aug 2011 23:10:28 +0000 (19 23:10 +0000)]
cramp: update test dependency to version to 0.15

Everything appears to be working...

12 years agot/test_isolate: bump kgio test version
Eric Wong [Fri, 19 Aug 2011 23:07:59 +0000 (19 23:07 +0000)]
t/test_isolate: bump kgio test version

We always try to test with the latest and greatest.

12 years agomore consistent logging for errors
Eric Wong [Wed, 17 Aug 2011 02:00:37 +0000 (16 19:00 -0700)]
more consistent logging for errors

The Unicorn.log_error method exists since 4.0.0

12 years agotest_isolate: bump cool.io test version
Eric Wong [Fri, 12 Aug 2011 07:53:21 +0000 (12 07:53 +0000)]
test_isolate: bump cool.io test version

Everything appears to work as expected under cool.io 1.1.0

12 years agoRemove deprecated Rainbows::HttpResponse
Pratik Naik [Fri, 5 Aug 2011 21:24:21 +0000 (5 22:24 +0100)]
Remove deprecated Rainbows::HttpResponse

Acked-by: Eric Wong <normalperson@yhbt.net>
12 years agoRainbows! 4.2.0 - Cramp WebSocket updates!v4.2.0
Eric Wong [Fri, 5 Aug 2011 23:31:18 +0000 (5 23:31 +0000)]
Rainbows! 4.2.0 - Cramp WebSocket updates!

This release includes updates to support WebSockets
under Cramp 0.14 and later.  This will be the last
release which supports Cramp 0.13.

There are no changes in this release for non-Cramp
users.

12 years agobump Cramp test dependency to 0.14
Eric Wong [Fri, 5 Aug 2011 23:17:07 +0000 (5 23:17 +0000)]
bump Cramp test dependency to 0.14

12 years agoevent_machine: APP needs to be in the main Client class
Eric Wong [Fri, 5 Aug 2011 19:08:12 +0000 (5 19:08 +0000)]
event_machine: APP needs to be in the main Client class

Oops, testing against new changes against cramp.git here

12 years agoevent_machine: add :em_client_class option
Eric Wong [Fri, 5 Aug 2011 18:44:32 +0000 (5 18:44 +0000)]
event_machine: add :em_client_class option

This can allow Cramp (and potentially other libraries)
to subclass or implement duck-type compatible versions
of Rainbows::EventMachine::Client.

12 years agocramp: bump test version to 0.13
Eric Wong [Fri, 5 Aug 2011 18:15:45 +0000 (5 18:15 +0000)]
cramp: bump test version to 0.13

cramp was just released a few days ago and all the
tested pieces seem to work...

12 years agoRainbows! 4.1.0 - minor internal cleanupsv4.1.0
Eric Wong [Sat, 30 Jul 2011 22:25:31 +0000 (30 22:25 +0000)]
Rainbows! 4.1.0 - minor internal cleanups

There are only some minor cleanups in this release and a bump to
kgio 2.5 to remove the dependency on io/wait.  kgio 2.5 or later
is now required (kgio 2.6+ will be required in the next
release).

12 years agoremove tcp_nodelay/tcp_nopush tweaking
Eric Wong [Thu, 21 Jul 2011 23:27:18 +0000 (21 23:27 +0000)]
remove tcp_nodelay/tcp_nopush tweaking

Unicorn 4.x already defaults match those of Rainbows!
to favor lower latency instead of lowered bandwidth
usage.

12 years agoremove unnecessary io/wait require
Eric Wong [Thu, 21 Jul 2011 23:17:48 +0000 (21 23:17 +0000)]
remove unnecessary io/wait require

kgio 2.5 added kgio_wait_*able methods

12 years agoRevert "http_server: cap timeout at 32-bit LONG_MAX seconds"
Eric Wong [Wed, 29 Jun 2011 19:57:05 +0000 (29 19:57 +0000)]
Revert "http_server: cap timeout at 32-bit LONG_MAX seconds"

Unicorn (> 4.0.1) already handles this for us,
not that it affects many people...

This reverts commit 37c376a9253ed62d134cbb4dbc6eaecc6076c77e.

12 years agot0044: do not assume setsockopt() finished
Eric Wong [Tue, 28 Jun 2011 23:32:26 +0000 (28 23:32 +0000)]
t0044: do not assume setsockopt() finished

Race conditions abound in the world of concurrency!

12 years agoFix Fiber* and WriterThread* breakage from removing io/wait
Eric Wong [Tue, 28 Jun 2011 08:17:01 +0000 (28 08:17 +0000)]
Fix Fiber* and WriterThread* breakage from removing io/wait

This fixes up breakage introduced in commit
905f0ff393629ddb4d70e3dc221b016128c47415 to switch to
kgio for timed, synchronous waiting.

12 years agorequire kgio 2.5 for kgio_wait_readable(timeout)
Eric Wong [Tue, 28 Jun 2011 07:39:35 +0000 (28 07:39 +0000)]
require kgio 2.5 for kgio_wait_readable(timeout)

Since kgio_wait_*able in kgio 2.5 takes an optional timeout
argument, we no longer have to load the extra "io/wait" module.
This saves us a small amount of some memory and also removes the
extra ioctl(FIONREAD) syscall IO#wait enforces.

Like IO#wait in Ruby 1.9.3dev, kgio_wait_readable may use
ppoll() to wait on high-numbered file descriptors as efficiently
as it waits on low-numbered descriptors.

12 years agobin/rainbows: release the OptionParser object from stack
Eric Wong [Tue, 28 Jun 2011 07:20:27 +0000 (28 07:20 +0000)]
bin/rainbows: release the OptionParser object from stack

No point in keeping it around to eat memory.

12 years agohttp_server: cap timeout at 32-bit LONG_MAX seconds
Eric Wong [Mon, 27 Jun 2011 21:20:42 +0000 (27 21:20 +0000)]
http_server: cap timeout at 32-bit LONG_MAX seconds

We can't wait for longer than 68 years.

12 years agoRainbows! 4.0.0 - MOAR concurrency for MOAR COARSv4.0.0
Eric Wong [Mon, 27 Jun 2011 09:20:37 +0000 (27 09:20 +0000)]
Rainbows! 4.0.0 - MOAR concurrency for MOAR COARS

Rainbows! now scales to more than 1024 worker processes without
special privileges.  To enable this, Rainbows! now depends on
Unicorn 4.x and thus raindrops[1].

client_max_header_size directive is added to limit per-client
memory usage in headers.

An experimental StreamResponseEpoll concurrency option now
exists to buffer outgoing responses without any thread-safe
dependencies.  Unlike the rest of Rainbows! which works fine
without nginx, this concurrency option is /only/ supported
behind nginx, even more strongly so than Unicorn itself.
non-nginx LAN clients are NOT supported for this.  This relies
on the sleepy_penguin[2] RubyGem (and Linux).

There are some minor bug fixes and cleanups all around.  See
"git log v3.4.0.." for details.

[1] http://raindrops.bogomips.org/
[2] http://bogomips.org/sleepy_penguin/

12 years agobump dependencies (kgio, unicorn, raindrops)
Eric Wong [Mon, 27 Jun 2011 09:18:39 +0000 (27 09:18 +0000)]
bump dependencies (kgio, unicorn, raindrops)

We now rely on Unicorn 4.0.0.  We'll use the latest
kgio and raindrops versions anyways.

12 years agoremove unused arg in Rainbows::Response.setup
Eric Wong [Mon, 27 Jun 2011 09:15:24 +0000 (27 09:15 +0000)]
remove unused arg in Rainbows::Response.setup

It hasn't been used in a while, but we kept it for
Zbatery version compatibility.

12 years agoepoll/client: properly close on all pipe responses
Eric Wong [Wed, 22 Jun 2011 07:40:03 +0000 (22 07:40 +0000)]
epoll/client: properly close on all pipe responses

Some pipe responses can trigger the on_deferred_write_complete
method without ever re-running the event loop.

This appears to be the result of the occasional t0050 failures.

12 years agot0050: improve diagnostics for this test
Eric Wong [Wed, 22 Jun 2011 07:05:37 +0000 (22 07:05 +0000)]
t0050: improve diagnostics for this test

This test seems to fail sometimes with Epoll and XEpoll...

12 years agot/test_isolate: remove unneeded comment
Eric Wong [Wed, 22 Jun 2011 02:25:56 +0000 (22 02:25 +0000)]
t/test_isolate: remove unneeded comment

That's been around forever, and we think Rubinius supports
that...

12 years agodev_fd_response: enable under Rubinius
Eric Wong [Wed, 22 Jun 2011 02:25:11 +0000 (22 02:25 +0000)]
dev_fd_response: enable under Rubinius

Untested, but it should work nowadays...

12 years agoUnicorn 4.x resync for ticker
Eric Wong [Wed, 22 Jun 2011 02:21:58 +0000 (22 02:21 +0000)]
Unicorn 4.x resync for ticker

This removes the extra per-process file descriptor and
replaces it with Raindrops.

12 years agot/test_isolate: drop Unicorn test dependency for now
Eric Wong [Wed, 22 Jun 2011 02:21:33 +0000 (22 02:21 +0000)]
t/test_isolate: drop Unicorn test dependency for now

It's already a runtime dependency

12 years agoremove IO_PURGATORY dependency
Eric Wong [Wed, 15 Jun 2011 22:42:49 +0000 (15 22:42 +0000)]
remove IO_PURGATORY dependency

We no longer need to put all listeners away since
Unicorn uses kgio.

12 years agoconfigurator: add client_max_header_size directive
Eric Wong [Sat, 11 Jun 2011 06:35:12 +0000 (11 06:35 +0000)]
configurator: add client_max_header_size directive

Lowering this will lower worst-case memory usage and mitigate some
denial-of-service attacks.  This should be larger than
client_header_buffer_size.

The default value is carried over from Mongrel and Unicorn.

12 years agodoc: remove docs for Rainbows::Fiber::* APIs
Eric Wong [Sat, 11 Jun 2011 05:46:52 +0000 (11 05:46 +0000)]
doc: remove docs for Rainbows::Fiber::* APIs

Do not encourage their use, really.

12 years agostream_response_epoll: update documentation
Eric Wong [Sat, 11 Jun 2011 05:39:01 +0000 (10 22:39 -0700)]
stream_response_epoll: update documentation

Yes, this concurrency model is our strangest yet.

12 years agoremove Rainbows.run method
Eric Wong [Sat, 11 Jun 2011 00:34:42 +0000 (11 00:34 +0000)]
remove Rainbows.run method

We can get away with a single stack frame reduction.  Unicorn
itself has more stack reductions, but Rainbows! is further
behind in this area.

12 years agoev_core: do not autochunk HTTP/1.0 (and 0.9) responses
Eric Wong [Fri, 10 Jun 2011 22:08:04 +0000 (10 22:08 +0000)]
ev_core: do not autochunk HTTP/1.0 (and 0.9) responses

Do not assume middlewares/applications are stupid and blindly
add chunking to responses (we have precedence set by
Rack::Chunked).

12 years agoev_core: use add_parse for trailers, too
Eric Wong [Fri, 10 Jun 2011 21:35:48 +0000 (10 21:35 +0000)]
ev_core: use add_parse for trailers, too

HttpParser#trailers and #headers are actually the same
method, so we'll just continue on.

12 years agogemspec: add GPLv3 to commented-out licenses section
Eric Wong [Fri, 10 Jun 2011 20:27:22 +0000 (10 20:27 +0000)]
gemspec: add GPLv3 to commented-out licenses section

Reduces inconsistency.

12 years agouse HttpParser#add_parse API in Unicorn 3.7.0
Eric Wong [Fri, 10 Jun 2011 02:13:55 +0000 (10 02:13 +0000)]
use HttpParser#add_parse API in Unicorn 3.7.0

It's easier-to-use in some cases.

12 years agotests: more fixes for StreamResponseEpoll
Eric Wong [Thu, 9 Jun 2011 23:47:37 +0000 (9 23:47 +0000)]
tests: more fixes for StreamResponseEpoll

Oops.

12 years agoresponse: sendfile_range fis for Rack::File in rack 1.3.0
Eric Wong [Thu, 9 Jun 2011 21:29:02 +0000 (9 21:29 +0000)]
response: sendfile_range fis for Rack::File in rack 1.3.0

Rack::File already sets Content-Range, so don't repeat work
and reparse Content-Length.

12 years agot/t9002: use Rack::Head
Eric Wong [Thu, 9 Jun 2011 21:08:38 +0000 (9 21:08 +0000)]
t/t9002: use Rack::Head

We send HEAD requests and expect body-less responses.
Noticed while running a newer rack version after re-isolating.

12 years agoupdate various RubyGem dependencies
Eric Wong [Thu, 9 Jun 2011 21:01:00 +0000 (9 21:01 +0000)]
update various RubyGem dependencies

Gotta keep using the latest and greatest.

12 years agostream_response_epoll: our most "special" concurrency option yet
Eric Wong [Thu, 9 Jun 2011 00:34:00 +0000 (9 00:34 +0000)]
stream_response_epoll: our most "special" concurrency option yet

This doesn't use Rainbows::Base so we have no keepalive support
at all.  This could eventually be an option for streaming
applications.

12 years agomove reopen_worker_logs to base
Eric Wong [Thu, 9 Jun 2011 00:23:28 +0000 (9 00:23 +0000)]
move reopen_worker_logs to base

We may not always use Rainbows! :Base since we don't want
keepalive/immediate log reopening in some cases.

12 years agodoc: remove --sanitize-html for pandoc
Eric Wong [Mon, 6 Jun 2011 17:24:05 +0000 (6 10:24 -0700)]
doc: remove --sanitize-html for pandoc

pandoc 1.8 no longer supports this, and we don't need it anyways
since we only generate documentation from our repository.

12 years agoxepoll_thread_*: update docs for Linux 3
Eric Wong [Tue, 31 May 2011 15:33:04 +0000 (31 08:33 -0700)]
xepoll_thread_*: update docs for Linux 3

Linux 3.0.0 is just around the corner and of course newer
than 2.6.

12 years agotest-lib: enable splice(2) for Linux 3.x
Eric Wong [Mon, 30 May 2011 21:31:23 +0000 (30 21:31 +0000)]
test-lib: enable splice(2) for Linux 3.x

The latest Linux series is now 3.x, not 2.6.x

12 years agoRainbows 3.4.0 - minor updates and fixesv3.4.0
Eric Wong [Sat, 21 May 2011 03:02:09 +0000 (21 03:02 +0000)]
Rainbows 3.4.0 - minor updates and fixes

SIGQUIT (graceful shutdown) now drops idle keepalive clients for
the concurrency models where maintaining an idle client is
relatively inexpensive: Coolio, CoolioThreadPool,
CoolioThreadSpawn, Epoll, EventMachine, XEpoll,
XEpollThreadPool, XEpollThreadSpawn.

Kgio.autopush now works properly for all multi-threaded
concurrency models (if you're using :tcp_nopush).

12 years agopkg.mk: update to the latest version
Eric Wong [Sat, 21 May 2011 03:01:50 +0000 (21 03:01 +0000)]
pkg.mk: update to the latest version

* locale fix for grep

12 years agouse and recommend sleepy_penguin 3.0.1
Eric Wong [Sat, 21 May 2011 01:23:50 +0000 (20 18:23 -0700)]
use and recommend sleepy_penguin 3.0.1

It's better under 1.9.3 (sleepy_penguin 3.0.1 was bogus)

12 years agouse and recommend sleepy_penguin 3.0.0
Eric Wong [Sat, 21 May 2011 01:23:50 +0000 (20 18:23 -0700)]
use and recommend sleepy_penguin 3.0.0

It's better under 1.9.3

12 years agot0044: increase test reliability
Eric Wong [Sat, 21 May 2011 01:15:30 +0000 (20 18:15 -0700)]
t0044: increase test reliability

12 years agotry_defer: enable documentation
Eric Wong [Fri, 20 May 2011 22:44:48 +0000 (20 15:44 -0700)]
try_defer: enable documentation

It should hopefully give this more visibility even though it's
an internal feature.

12 years agoxepoll_thread_pool/client: improve autopush support
Eric Wong [Sat, 21 May 2011 01:13:21 +0000 (20 18:13 -0700)]
xepoll_thread_pool/client: improve autopush support

We need to trigger a recv() to uncork the response.
This won't affect fairness (much) since all recv()s
are non-blocking and a successful header parse will
put us in the back of the queue.

12 years ago.gitignore: add tags/TAGS files
Eric Wong [Fri, 20 May 2011 22:30:11 +0000 (20 15:30 -0700)]
.gitignore: add tags/TAGS files

Some folks use them.

12 years agoadd tests for Kgio autopush on Linux
Eric Wong [Fri, 20 May 2011 22:17:21 +0000 (20 15:17 -0700)]
add tests for Kgio autopush on Linux

We can support it fully for a subset of concurrency models where
we have full control over buffering and HTTP/1.1 keepalive
clients.

12 years agoadd test for SIGQUIT disconnect
Eric Wong [Fri, 20 May 2011 21:24:14 +0000 (20 14:24 -0700)]
add test for SIGQUIT disconnect

This will only be supported for certain concurency models, but
it's probably good enough.

12 years agoevent_machine: disconnect idle clients at on SIGQUIT
Eric Wong [Fri, 20 May 2011 21:22:37 +0000 (20 14:22 -0700)]
event_machine: disconnect idle clients at on SIGQUIT

Since it's cheap to maintain keepalive clients with EM, we need
a way of disconnecting them in a timely fashion on rare SIGQUIT
events.

12 years agoclient: use kgio_write across the board
Eric Wong [Fri, 20 May 2011 18:58:04 +0000 (20 18:58 +0000)]
client: use kgio_write across the board

This should enable Kgio "autopush" support for ThreadSpawn,
ThreadPool, XEpollThreadSpawn, and XEpollThreadPool.

(still needs tests)

12 years agocoolio* + *epoll*: drop keepalive clients on SIGQUIT
Eric Wong [Fri, 20 May 2011 09:19:51 +0000 (20 09:19 +0000)]
coolio* + *epoll*: drop keepalive clients on SIGQUIT

In concurrency models long keepalive times are cheap (and thus
more likely to be used), this allows Rainbows! to gracefully
shut down more quickly.

12 years agoepoll/xepoll: more consistent client implementations
Eric Wong [Fri, 20 May 2011 06:54:59 +0000 (19 23:54 -0700)]
epoll/xepoll: more consistent client implementations

There's less logic in the server this way and easier
to potentially share code this way.

12 years agodoc: recommend io_splice 4.1.1 or later
Eric Wong [Wed, 18 May 2011 00:38:12 +0000 (17 17:38 -0700)]
doc: recommend io_splice 4.1.1 or later

io_splice 4.1.1 works around issues with socket
buffers filling up pipe buffers on blocking splice.

See http://lkml.org/lkml/2009/1/13/478 for a better
explanation.

12 years agoRainbows! 3.3.0 - doc improvements and morev3.3.0
Eric Wong [Mon, 16 May 2011 21:12:27 +0000 (16 14:12 -0700)]
Rainbows! 3.3.0 - doc improvements and more

* improved documentation all around, suggestions/comments to further
  improve documentation is greatly welcome at: rainbows-talk@rubyforge.org

* added GPLv3 option to the license (now (Ruby|GPLv2|GPLv3), though
  Unicorn is still (Ruby|GPLv2) for now)

* added client_header_buffer_size config directive (default 1K)

* small default header buffer size (16K => 1K) to reduce memory usage,
  Rails apps with cookie sessions may want to increase this (~2K)

* all concurrency models default to 50 connections per process

* all concurrency models with a secondary :pool_size parameter also
  default to 50 (threads/fibers/whatever)

* RLIMIT_NOFILE and RLIMIT_NPROC are automatically increased if needed

* Rainbows::ThreadTimeout middleware rewritten, still not recommended,
  lazy people should be using Unicorn anyways :)

* Several experimental Linux-only edge-triggered epoll options:
  XEpollThreadSpawn, XEpollThreadPool, XEpoll, and Epoll.
  The latter two were in previous releases but never announced.
  These require the "sleepy_penguin", "raindrops", and "sendfile" RubyGems

=== Deprecations

* Rainbows::Fiber::IO* APIs all deprecated, Rainbows! will avoid
  having any concurrency model-specific APIs in the future and
  also avoid introducing new APIs for applications.

* Fiber-based concurrency models are no longer recommended, they're
  too fragile for most apps, use at your own risk (they'll continue to
  be supported, however).  Linux NPTL + Ruby 1.9 is pretty lightweight
  and will be even lighter in Ruby 1.9.3 if you're careful with stack
  usage in your C extensions.

12 years agowriter_thread_*: fix sendfile detection under Ruby 1.8
Eric Wong [Mon, 16 May 2011 21:01:47 +0000 (16 21:01 +0000)]
writer_thread_*: fix sendfile detection under Ruby 1.8

I can't wait until I stop supporting Ruby 1.8

12 years agodocument RubyGem requirements
Eric Wong [Mon, 16 May 2011 20:42:10 +0000 (16 20:42 +0000)]
document RubyGem requirements

Hopefully makes things easier to try out.

12 years agodoc: cleanup rdoc for Rainbows module
Eric Wong [Mon, 16 May 2011 20:32:29 +0000 (16 20:32 +0000)]
doc: cleanup rdoc for Rainbows module

The only supported method is Rainbows.sleep in here

12 years agouse :pool_size for RLIMIT_NPROC with thread pool models
Eric Wong [Mon, 16 May 2011 20:13:00 +0000 (16 20:13 +0000)]
use :pool_size for RLIMIT_NPROC with thread pool models

Only needed for Ruby 1.9

12 years agomore reliable shutdown for epoll concurrency models
Eric Wong [Mon, 16 May 2011 20:05:12 +0000 (16 20:05 +0000)]
more 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.

12 years agotests: unify checks for copy_stream and threaded app dispatch
Eric Wong [Mon, 16 May 2011 19:43:38 +0000 (16 19:43 +0000)]
tests: unify checks for copy_stream and threaded app dispatch

This makes things easier to maintain as we add more concurrency
options.

12 years agoadd "copy_stream" config directive
Eric Wong [Mon, 16 May 2011 19:04:06 +0000 (16 19:04 +0000)]
add "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).

12 years agoconfigurator: update user-facing documentation
Eric Wong [Tue, 10 May 2011 23:34:51 +0000 (10 16:34 -0700)]
configurator: update user-facing documentation

Finally, we have all methods in configurator and it's
much easier to document!

12 years agomax_body: documentation updates
Eric Wong [Tue, 10 May 2011 23:33:07 +0000 (10 16:33 -0700)]
max_body: documentation updates

It can't be used as middleware for fully-buffering concurrency
models.

12 years agoLICENSE: add GPLv3 to license terms
Eric Wong [Tue, 10 May 2011 22:35:21 +0000 (10 15:35 -0700)]
LICENSE: add GPLv3 to license terms

GPLv2 and Ruby-specific terms remain intact, but this means
we can be combined and redistributed with GPLv3-only software
(once Unicorn has GPLv3 added to its license).

12 years agoconfigurator: move validation logic over
Eric Wong [Mon, 9 May 2011 04:39:54 +0000 (9 04:39 +0000)]
configurator: 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.

12 years agodoc: better document :pool_size options
Eric Wong [Mon, 9 May 2011 02:24:26 +0000 (9 02:24 +0000)]
doc: better document :pool_size options

CoolioThreadPool has had it supported forever, but
only NeverBlock had it documented.

12 years agoTODO: misc updates
Eric Wong [Mon, 9 May 2011 02:15:55 +0000 (9 02:15 +0000)]
TODO: misc updates

Some things were never going to get done due to lack of interest
from users.

12 years agodoc: update comparison and README
Eric Wong [Mon, 9 May 2011 02:13:51 +0000 (9 02:13 +0000)]
doc: update comparison and README

Clearly users need to know about more options