about summary refs log tree commit homepage
path: root/lib
DateCommit message (Collapse)
2009-09-08unicorn 0.10.3r v0.10.3r
* multiple listener and graceful shutdown support * enable murder_lazy_workers to nuke deadlocked processes * HTTP keepalive/pipelining support * remove Rev monkey patch, depend on rev 0.3.0
2009-09-08rainbows: remove Rev monkey patch
rev 0.3.0 is out now so we don't need to monkey patch Rev anymore.
2009-08-19rainbows: HTTP keepalive/pipelining support
keepalive/pipelining absolutely does not make sense with classic Unicorn, but it does make sense when connections are cheap with Revactor. Of course any server that serves multiple clients concurrently within the same process is less robust anyways.
2009-08-19rainbows: avoid object creation overhead for ticker
While gettimeofday() isn't even a syscall on modern x86_64 Linux machines; Time objects aren't cheap. So avoid using time entirely as a fchmod argument and stick with 0s and 1s.
2009-08-19rainbows: enable murder_lazy_workers
The main loop ticks every second and we can chmod during that time to keep ourselves alive. If we're hosting some app that does stupid blocking calls, then our userspace scheduler will have no hope and our parent will nuke us for it.
2009-08-19rainbows: embedded test app for multiple listeners and sleep
2009-08-19rainbows: multiple listener and graceful shutdown support
2009-08-18unicorn 0.10.2r v0.10.2r
2009-08-18rainbows: make the embedded SHA1 app Rack::Lint-safe
Otherwise we're promoting broken practices
2009-08-18rainbows: monkey-patch Rev::TCPListener for now
So we can reuse our existing TCPServer objects. Patches have already been submitted (but not yet accepted) to rev for upstream inclusion here: http://rubyforge.org/pipermail/rev-talk/2009-August/000097.html
2009-08-18Actually hook up Rainbows to the rest of the beast
Allow the --rainbows/-R command-line option to be passed to activate Rainbows!!!1
2009-08-180.10.0r - rainbows! v0.10.0r
2009-08-18Rainbows!
2009-08-18http_response: allow reentrancy
The overhead of the temporary array is too little to be worth worrying about...
2009-08-18tee_input: allow using Revactor::TCP::Socket objects
The Revactor::TCP::Socket#read method without any arguments is more or less equivalent to TCPSocket#readpartial without an explicit buffer. Since we rely on the buffer being modified/replaced, monkey patch that object it to replace the buffer with our own since we rely on modifying the existing buffer passed to us.
2009-08-16unicorn 0.90.0 v0.90.0
2009-08-16app/inetd: explicitly close pipe descriptors on CatBody#close
Since Rack permits body objects to have #close called on them, we can safely close our pipe readers immediately instead of waiting on the GC to close them (like we do for TeeInput tempfiles).
2009-08-15Remove explicit requires for Rack things
Rack is autoload-based and so are we.
2009-08-15const: remove unused constants
2009-08-15http_response: pass through unknown status codes
This lets clients can pass through newly-invented status codes that Rack does not know about.
2009-08-15Fix documentation for Util.reopen_logs
2009-08-15tee_input: make interface more usable outside of Unicorn
TeeInput being needed is now (once again) an uncommon code path so there's no point in relying on global constants. While we're at it, allow StringIO to be used in the presence of small inputs; too.
2009-08-15http_request: reinstate empty StringIO optimization
This makes a noticeable difference on light GET/HEAD requests. Heck, even the tests run a few seconds faster.
2009-08-10http: rename read_body to filter_body
This method is strictly a filter, it does no I/O so "read" is not an appropriate name to give it.
2009-08-09Switch to Ragel/C-based chunk/trailer parser
This should be more robust, faster and easier to deal with than the ugly proof-of-concept regexp-based ones.
2009-07-19unicorn 0.9.2 v0.9.2
2009-07-19app/exec_cgi: fix 1.9 compatibility
"/dev/null" must be opened in binary mode for Rack-compliance. Additionally, avoid '' to create an empty string and use Unicorn::Z instead. Conflicts: lib/unicorn/app/exec_cgi.rb
2009-07-19Remove core Tempfile dependency (1.9.2-preview1 compat)
With the 1.9.2preview1 release (and presumably 1.9.1 p243), the Ruby core team has decided that bending over backwards to support crippled operating/file systems was necessary and that files must be closed before unlinking. Regardless, this is more efficient than using Tempfile because: 1) no delegation is necessary, this is a real File object 2) no mkdir is necessary for locking, we can trust O_EXCL to work properly without unnecessary FS activity 3) no finalizer is needed to unlink the file, we unlink it as soon as possible after creation.
2009-07-16HttpRequest: no need for a temporary variable
Regexps can be run against nil just fine
2009-07-16http_request: don't support apps that close env["rack.input"]
Anything that calls close on a rack.input body is violating Rack::Lint; so don't waste cycles supporting them. Being liberal in things we accept tolerates bad behavior and Unicorn doesn't have a large userbase that would scream bloody murder if we stopped supporting broken behavior.
2009-07-16move all #gets logic to tee_input out of chunked_reader
This simplifies chunked_reader substantially with a slight increase in tee_input complexity. This is beneficial because chunked_reader is more complex to begin with and more likely to experience correctness issues.
2009-07-15Rename unicorn/http11 => unicorn_http
We couldn't do proper namespacing for the C module so there was a potential conflict with Init_http11() in Mongrel. This was needed because Mongrel's HTTP parser could be used in some applications and we may be unfortunate enough need to support them.
2009-07-09unicorn 0.9.1 (merge 0.8.2) v0.9.1
* maint: unicorn 0.8.2 always set FD_CLOEXEC on sockets post-accept() Minor cleanups to core Re-add support for non-portable socket options Retry listen() on EADDRINUSE 5 times ever 500ms Unbind listeners as before stopping workers Conflicts: CHANGELOG lib/unicorn.rb lib/unicorn/configurator.rb lib/unicorn/const.rb
2009-07-09unicorn 0.8.2 v0.8.2
2009-07-09always set FD_CLOEXEC on sockets post-accept()
FD_CLOEXEC is not guaranteed to be inherited by the accept()-ed descriptors even if the listener socket has this set. This can be a problem with applications that fork+exec long running background processes. Thanks to Paul Sponagl for helping me find this.
2009-07-08Minor cleanups to core
(cherry picked from commit ec70433f84664af0dff1336845ddd51f50a714a3)
2009-07-08Re-add support for non-portable socket options
Now that we support tunnelling arbitrary protocols over HTTP as well as "100 Continue" responses, TCP_NODELAY actually becomes useful to us. TCP_NODELAY is actually reasonably portable nowadays; even. While we're adding non-portable options, TCP_CORK/TCP_NOPUSH can be enabled, too. Unlike some other servers, these can't be disabled explicitly/intelligently to force a flush, however. However, these may still improve performance with "normal" HTTP applications (Mongrel has always had TCP_CORK enabled in Linux). While we're adding OS-specific features, we might as well support TCP_DEFER_ACCEPT in Linux and FreeBSD the "httpready" accept filter to prevent abuse. These options can all be enabled on a per-listener basis. (cherry picked from commit 563d03f649ef31d2aec3505cbbed1e015493b8fc)
2009-07-08Retry listen() on EADDRINUSE 5 times ever 500ms
This number of retries and delay taken directly from nginx (cherry picked from commit d247b5d95a3ad2de65cc909db21fdfbc6194b4c9)
2009-07-08Unbind listeners as before stopping workers
This allows another process to take our listeners sooner rather than later. (cherry picked from commit 8c2040127770e40e344a927ddc187bf801073e33)
2009-07-04Minor cleanups to core
2009-07-04Favor Struct members to instance variables
There's a small memory reduction to be had when forking oodles of processes and the Perl hacker in me still gets confused into thinking those are arrays...
2009-07-03Avoid temporary array creation
Array#+= creates a new array before assigning, Array#concat just appends one array to another without an intermediate one.
2009-07-01unicorn 0.9.0 v0.9.0
2009-07-01Force streaming input onto apps by default
This change gives applications full control to deny clients from uploading unwanted message bodies. This also paves the way for doing things like upload progress notification within applications in a Rack::Lint-compatible manner. Since we don't support HTTP keepalive, so we have more freedom here by being able to close TCP connections and deny clients the ability to write to us (and thus wasting our bandwidth). While I could've left this feature off by default indefinitely for maximum backwards compatibility (for arguably broken applications), Unicorn is not and has never been about supporting the lowest common denominator.
2009-07-01tee_input: avoid ignoring initial body blob
This was causing the first part of the body to be missing when an HTTP client failed to delay between sending the header and body in the request.
2009-07-01Move "Expect: 100-continue" handling to the app
This gives the app ability to deny clients with 417 instead of blindly making the decision for the underlying application. Of course, apps must be made aware of this.
2009-07-01Re-add support for non-portable socket options
Now that we support tunnelling arbitrary protocols over HTTP as well as "100 Continue" responses, TCP_NODELAY actually becomes useful to us. TCP_NODELAY is actually reasonably portable nowadays; even. While we're adding non-portable options, TCP_CORK/TCP_NOPUSH can be enabled, too. Unlike some other servers, these can't be disabled explicitly/intelligently to force a flush, however. However, these may still improve performance with "normal" HTTP applications (Mongrel has always had TCP_CORK enabled in Linux). While we're adding OS-specific features, we might as well support TCP_DEFER_ACCEPT in Linux and FreeBSD the "httpready" accept filter to prevent abuse. These options can all be enabled on a per-listener basis.
2009-06-30Retry listen() on EADDRINUSE 5 times ever 500ms
This number of retries and delay taken directly from nginx
2009-06-30Unbind listeners as before stopping workers
This allows another process to take our listeners sooner rather than later.
2009-06-30TrailerParser integration into ChunkedReader
Support for the "Trailer:" header and associated Trailer lines should be reasonably well supported now