about summary refs log tree commit homepage
path: root/lib/rainbows/epoll
DateCommit message (Collapse)
2019-01-02quiet mismatched indentation warnings
Ruby trunk started warning about more mismatched indentations starting around r62836.
2015-11-21Ruby 1.9.3+-only cleanups
unicorn 5 will only support Ruby 1.9.3 and later, so remove some checks for Hash#compare_by_identity and IO.copy_stream which we know exist in Ruby 1.9. Favor &:sym proc dispatch to avoid unnecessary captures and bytecode size increases, too. Finally, ensure we fail fast by converting some literal hashes to use non-arrow syntax for symbolic keys.
2015-11-21bump to unicorn 5.0.1, use monotonic clock
The timeout (mis)feature in unicorn uses the monotonic clock if available. We must follow suit to avoid having our timeout functionality completely broken.
2015-11-18http_parser: workaround hijack changes in unicorn 5
unicorn lost the hijack_setup method in version 5, so we must recreate it ourselves.
2015-11-18reduce constant lookup dependencies
Unicorn 5 removes some constants we were using, and constant lookups + inline caching are waste of time anyways on newer Rubies with the opt_str_freeze bytecode instruction. This may reduce performance for folks on older Rubies (probably not noticeable); but improves performance for folks on newer Rubies.
2013-02-26epoll/*: remove user-space array as active queue
This prevents pathological starvation cases where the user-space ready-list can be repopulated infinitely. With EPOLLONESHOT, epoll itself may be used for this task (at a slightly higher cost) by enabling read/write checks, as the epoll ready-list preserves event ordering when used with EPOLLONESHOT.
2013-02-11hijacking support for Rack 1.5.x users
This requires Rack 1.5.x and unicorn 4.6.0 for hijacking support. Older versions of Rack continue to work fine, but we must use unicorn 4.6.0 features to support this.
2013-01-24epoll: ensure closing of pipelined clients if required
on_read normally relies on the close checking in on_readable, but on_deferred_write_complete may be called from on_writable instead (bypassing the close check of on_readable). This affects both Epoll and XEpoll users, but only if they were sending responses via body#to_path and triggering on_deferred_write_complete. While we're at it, favor non-recursive want_more instead of calling on_readable recursively in ev_write_responses to prevent stack growth.
2012-06-18epoll*: 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.
2011-06-22epoll/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.
2011-05-20coolio* + *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.
2011-05-20epoll/xepoll: more consistent client implementations
There's less logic in the server this way and easier to potentially share code this way.
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-08Revert "epoll: fixes for Ruby 1.9.3dev"
Fixed in kgio 2.4.0 now This reverts commit a1168e7d2bfe182896f139d051ef099616fd1646.
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-04-11epoll: fixes for Ruby 1.9.3dev
2011-03-20fix various warnings with "check-warnings" target
Run under 1.9.3dev
2011-03-10switch from IO#sendfile_nonblock to IO#trysendfile
IO#trysendfile does not raise exceptions for common EAGAIN errors, making it far less expensive to use with the following concurrency models: * Coolio * CoolioFiberSpawn * Revactor * FiberSpawn * FiberPool This requires the new sendfile 1.1.0 RubyGem and removes support for the sendfile 1.0.0. All sendfile users must upgrade or be left without sendfile(2) support. IO#sendfile behaves the same if you're using a multi-threaded concurrency option, but we don't detect nor use it unless IO#trysendfile exists.
2011-02-07doc: rdoc cleanups and fixes
Don't need to document things that aren't ready, yet.
2011-02-05*epoll: refactor common loop code
acceptor thread pools could use some work, still
2011-02-05*epoll: consolidate re-run logic
There's a lot of code duplication here :<
2011-02-04bump required Unicorn dependency for Kgio
We want to use the singleton methods in Kgio to reduce conditionals.
2011-02-04epoll: handle EINTR properly in Ruby-space
We can't work around it effectively in the C extension itself. This requires the latest sleepy_penguin gem.
2011-01-26epoll/client: avoid unnecessary Epoll#set calls
We should only attempt to modify the descriptor when we block, and not for subsequent events.
2011-01-24epoll/client: thread-safety for write queuing
We're living on the EDGE and mixing epoll with threads :D
2011-01-21epoll/client: minor optimization
We know @wr_queue is empty since we just initialized it and the first thing an HTTP client does is read.
2011-01-21ev_core: force input to be given to app_call
No need to setting an ivar for most requests
2011-01-21epoll/client: factor out on_close method
We'll override it, maybe...
2011-01-21epoll/client: remove unused client
We don't do Level-Triggered I/O around here
2011-01-21epoll: reduce expiration calls and Time objects
We'll lower our precision for keepalive timeouts a little and and reduce our Time object allocation rate.
2011-01-21ev_core: garbage reduction
We don't need to allocate new string objects for short-lived strings. We'll pay the price of a constant lookup instead.
2011-01-21epoll: use newer sleepy_penguin
We can eliminate the State module to simplify our code since 1.3.x keeps better track of things.
2011-01-21epoll: use sleepy_penguin default size for epoll_wait
It was based off the nginx window of 64 events. Not that any servers are really that busy...
2011-01-20epoll: ignore ECONNRESET errors
Nothing we can do about that from clients. Perhaps kgio should just return nil for those...
2011-01-19initial edge-triggered epoll model
Coolio and EventMachine only use level-triggered epoll, but being Rainbows!, we live on the EDGE!