about summary refs log tree commit homepage
path: root/lib/unicorn
DateCommit message (Collapse)
2010-10-27unicorn 2.0.0 - mostly internal cleanups v2.0.0
Despite the version number, this release mostly features internal cleanups for future versions of Rainbows!. User visible changes include reductions in CPU wakeups on idle sites using high timeouts. Barring possible portability issues due to the introduction of the kgio library, this release should be ready for all to use. However, 1.1.x (and possibly 1.0.x) will continue to be maintained. Unicorn 1.1.5 and 1.0.2 have also been released with bugfixes found during development of 2.0.0.
2010-10-27configurator: reloading with unset values restores default
If a configuration directive is set at startup and later unset, it correctly restores the original default value as if it had never been set in the first place. This applies to the majority of the configuration values with a few exceptions: * This only applies to stderr_path and stdout_path when daemonized (the usual case, they'll be redirected to "/dev/null"). When NOT daemonized, we cannot easily redirect back to the original stdout/stderr destinations. * Unsetting working_directory does not restore the original working directory where Unicorn was started. As far as we can tell unsetting this after setting it is rarely desirable and greatly increases the probability of user error.
2010-10-27configurator: use "__send__" instead of "send"
It's less ambiguous since this is a network server after all.
2010-10-27configurator: switch to normal class
No point in using a Struct for (1.8) space-efficiency if there's only one of them.
2010-10-27reduce master process wakeups
To reduce CPU wakeups and save power during off hours, we can precalculate a safe amount to sleep before killing off idle workers.
2010-10-26master: remove limit on queued signals
If a moronic sysadmin is sending too many signals, just let them do it. It's likely something is terribly wrong when the server is overloaded with signals, so don't try to protect users from it. This will also help in case where TTOU signals are sent too quickly during shutdown, although sleeping between kill(2) syscalls is always a good idea because of how non-real-time signals are delivered.
2010-10-09unicorn 2.0.0pre3 - more small fixes v2.0.0pre3
There is a new Unicorn::PrereadInput middleware to which allows input bodies to be drained off the socket and buffered to disk (or memory) before dispatching the application. HTTP Pipelining behavior is fixed for Rainbows! There are some small Kgio fixes and updates for Rainbows! users as well.
2010-10-09add PrereadInput middleware to get around TeeInput
This may be useful for some apps that wish to drain the body before acquiring an app-wide lock. Maybe it's more useful with Rainbows!...
2010-10-07unicorn 2.0.0pre2 - releases are cheap v2.0.0pre2
Internal changes/cleanups for Rainbows!
2010-10-07start using more compact parser API
This should be easier for Rainbows! to use
2010-10-07http_server: avoid method redefinition warnings
We clobber the accessor methods.
2010-10-06unicorn 2.0.0pre1 - a boring "major" release v2.0.0pre1
Mostly internal cleanups for future versions of Rainbows! and people trying out Rubinius. There are tiny performance improvements for Ruby 1.9.2 users which may only be noticeable with Rainbows! Unicorn 1.1.x users are NOT required to upgrade.
2010-10-06various cleanups and reduce indentation
This also affects some constant scoping rules, but hopefully makes things easier to follow. Accessing ivars (not via accessor methods) are also slightly faster, so use them in the criticial process_client code path.
2010-10-05upgrade to kgio 1.2.0
This provides the kgio_read! method which is like readpartial, only significantly cheaper when a client disconnects on us.
2010-10-05tee_input: use kgio to avoid stack traces on EOF
TeeInput methods may be invoked deep in the stack, so avoid giving them more work to do if a client disconnects due to a bad upload.
2010-10-05tmpio: use super instead of an explicit method
This is for compatibility with Ruby implementations such as Rubinius that use "IO.new" internally inside "IO.open"
2010-10-05util: uindent use less ambiguous constant scoping
This hopefully makes things easier to read and follow.
2010-10-05Unicorn::Util.tmpio => Unicorn::TmpIO.new
This is slightly shorter and hopefully easier to find.
2010-10-05start using kgio, the kinder, gentler I/O library
This should hopefully make the non-blocking accept() situation more tolerable under Ruby 1.9.2.
2010-10-04http_request: reformat and small reorg
This hides more HTTP request logic inside our object.
2010-10-04tee_input: update interface to use HttpRequest
This should ensure we have less typing to do.
2010-10-04http_request: avoid globals
Rainbows! will be able to reuse this.
2010-10-04split out worker to a separate file
This hopefully makes things easier to read, follow, and find since it's mostly documentation...
2010-10-04http_response: avoid singleton method
There's no need for a response class or object since Rack just uses an array as the response. So use a procedural style which allows for easier understanding. We shall also support keepalive/pipelining in the future, too.
2010-10-04avoid unlinking actively listening sockets
While we've always unlinked dead sockets from nuked/leftover processes, blindly unlinking them can cause unnecessary failures when an active process is already listening on them. We now make a simple connect(2) check to ensure the socket is not in use before unlinking it. Thanks to Jordan Ritter for the detailed bug report leading to this fix. ref: http://mid.gmane.org/8D95A44B-A098-43BE-B532-7D74BD957F31@darkridge.com
2010-08-30remove nasty ugly hacks at startup
These nasty hacks were breaking Rubinius compatibility. This can be further cleaned up, too.
2010-08-28make log reopens even more robust in threaded apps
A follow-up to 4b23693b9082a84433a9e6c1f358b58420176b27 If multithreaded programming can be compared to juggling chainsaws, then multithreaded programming with signal handlers in play is akin to juggling chainsaws on a tightrope over shark-infested waters.
2010-08-28make log reopens more robust in multithreaded apps
IOError may occur due to race conditions as another thread may close the file immediately after we call File#closed? to check. Errno::EBADF may occur in some applications that close a file descriptor without notifying Ruby (or if two IO objects refer to the same descriptor, possibly one of them using IO#for_fd).
2010-07-13launcher: do not re-daemonize when USR2 upgrading
This was accidentally enabled when ready_pipe was developed. While re-daemonizing appears harmless in most cases this makes detecting backed-out upgrades from the original master process impossible.
2010-07-11tee_input: fix constant resolution for client EOF
Noticed while hacking on a Zbatery-using application
2010-07-08cleanup "stringio" require
"stringio" is part of the Ruby distro and we use it in multiple places, so avoid re-requiring it.
2010-07-08prefer "[]" to "first"/"last" where possible
"[]" is slightly faster under Ruby 1.9 (but slightly slower under 1.8).
2010-07-08tee_input: safer record separator ($/) handling
Different threads may change $/ during execution, so cache it at function entry to a local variable for safety. $/ may also be of a non-binary encoding, so rely on Rack::Utils.bytesize to portably capture the correct size. Our string slicing is always safe from 1.9 encoding: both our socket and backing temporary file are opened in binary mode, so we'll always be dealing with binary strings in this class (in accordance to the Rack spec).
2010-07-06socket_helper: disable documentation for internals
2010-07-06socket_helper: cleanup FreeBSD accf_* detection
Instead of detecting at startup if filters may be used, just try anyways and log the error. It is better to ask for forgiveness than permission :)
2010-07-06socket_helper: no reason to check for logger method
We only use this module in HttpServer and our unit test mocks it properly.
2010-07-06configurator: cleanup RDoc, un-indent
No point in redeclaring the Unicorn module in here.
2010-07-06configurator: documentation for new accept options
The defaults should be reasonable, but there may be folks who want to experiment.
2010-07-06socket_helper: move defaults to the DEFAULTS constant
This is to allow Rainbows! to override the defaults.
2010-07-03socket_helper: tunables for tcp_defer_accept/accept_filter
Under Linux, this allows users to tune the time (in seconds) to defer connections before allowing them to be accepted. The behavior of TCP_DEFER_ACCEPT changed with Linux 2.6.32 and idle connections may still be accept()-ed after the specified value in seconds. A small value of '1' remains the default for Unicorn as Unicorn does not worry about slow clients. Higher values provide better DoS protection for Rainbows! but also increases kernel memory usage. Allowing "dataready" for FreeBSD accept filters will allow SSL sockets to be used in the future for HTTPS, too.
2010-06-28http_response: this should be a module, not a class
This affects Rainbows!, but Rainbows! is still using the Unicorn 1.x branch. While we're at it, avoid redeclaring the "Unicorn" module, it makes documentation noisier.
2010-06-24const: bump UNICORN_VERSION to 2.0.0pre
2010-06-24tee_input: undent, avoid (re)-declaring "module Unicorn"
It makes RDoc look better and cleaner, since we don't do anything in the Unicorn namespace.
2010-06-24tee_input: allow tuning of client_body_buffer_size/io_size
Some folks may require more fine-grained control of buffering and I/O chunk sizes, so we'll support them (unofficially, for now).
2010-06-24tee_input: (nitpick) use IO#rewind instead of IO#seek(0)
no need to pass an extra argument
2010-06-17unicorn 1.0.0 - yes, this is a real project v1.0.0
There are only minor changes since 0.991.0. For users clinging onto the past, MRI 1.8.6 support has been restored. Users are strongly encouraged to upgrade to the latest 1.8.7, REE or 1.9.1. For users looking towards the future, the core test suite and the Rails 3 (beta) integration tests pass entirely under 1.9.2 preview3. As of the latest rubinius.git[1], Rubinius support is nearly complete as well. Under Rubinius, signals may corrupt responses as they're being written to the socket, but that should be fixable transparently to us[4]. Support for the hardly used, hardly documented[2] embedded command-line switches in rackup config (.ru) files is is also broken under Rubinius. The recently-released Rack 1.2.1 introduced no compatiblity issues[3] in core Unicorn. We remain compatible with all Rack releases starting with 0.9.1 (and possibly before). [1] tested with Rubinius upstream commit cf4a5a759234faa3f7d8a92d68fa89d8c5048f72 [2] lets avoid the Dueling Banjos effect here :x [3] actually, Rack 1.2.1 is broken under 1.8.6. [4] http://github.com/evanphx/rubinius/issues/373
2010-06-15workaround rbx not reopening logs to stderr/stdout
While log reopening worked reliably for newly-created File objects in the unit tests, the $stderr and $stdout handles that get redirected did not get reopened reliably under Rubinius. We work around this by relying on Rubinius internals and directly setting the @path instance variable. This is harmless for MRI and should be harmless for other any other Ruby implementations we'll eventually support. ref: http://github.com/evanphx/rubinius/issues/360
2010-06-14tee_input: update documentation for Rack 1.2
Rack 1.2 removed the +size+ method requirement, but we'll still support it since Rack 1.2 doesn't _prohibit_ it, and Rack 1.[01] applications will continue to exist for a while.
2010-06-14app/exec_cgi: rack.input may not respond to #size
Rack 1.2 no longer requires "rack.input" objects respond to size.
2010-06-11cleanup: use modules were applicable
No point in having namespaces be classes when we never create instances of them...