summary refs log tree commit homepage
AgeCommit message (Collapse)AuthorFilesLines
2009-07-19unicorn 0.8.3 v0.8.3Eric Wong2-1/+2
2009-07-19app/exec_cgi: fix 1.9 compatibilityEric Wong1-2/+2
"/dev/null" must be opened in binary mode for Rack-compliance. Additionally, avoid '' to create an empty string and use Unicorn::Z instead.
2009-07-19fix tests to run correctly under 1.9.2preview1Eric Wong2-32/+34
test/test_helper doesn't seem to be required correctly anymore, since we know our own module/test names don't conflict, just fix RUBYLIB to include $(test_prefix) With test_util.rb, using #reopen with Tempfile objects seems prone to the objects being closed. Not completely sure what is going on but I'll just sidestep around it since I've stopped trusting Tempfile by now... (cherry picked from commit 344b85ff28e160daa6563ab7c80b733abdeb874a)
2009-07-19Remove core Tempfile dependency (1.9.2-preview1 compat)Eric Wong3-20/+29
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. (cherry picked from commit 344b85ff28e160daa6563ab7c80b733abdeb874a) Conflicts: lib/unicorn.rb lib/unicorn/app/exec_cgi.rb lib/unicorn/tee_input.rb
2009-07-09unicorn 0.8.2 v0.8.2Eric Wong2-1/+2
2009-07-09always set FD_CLOEXEC on sockets post-accept()Eric Wong1-0/+1
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 coreEric Wong1-5/+5
(cherry picked from commit ec70433f84664af0dff1336845ddd51f50a714a3)
2009-07-08Re-add support for non-portable socket optionsEric Wong2-2/+72
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 500msEric Wong1-3/+10
This number of retries and delay taken directly from nginx (cherry picked from commit d247b5d95a3ad2de65cc909db21fdfbc6194b4c9)
2009-07-08Unbind listeners as before stopping workersEric Wong1-2/+1
This allows another process to take our listeners sooner rather than later. (cherry picked from commit 8c2040127770e40e344a927ddc187bf801073e33)
2009-05-28unicorn 0.8.1 v0.8.1Eric Wong2-1/+2
2009-05-28Consistent logger assignment for multiple objectsEric Wong1-1/+4
Bah, it's so much busy work to deal with this as configuration option. Maybe I should say we allow any logger the user wants, as long as it's $stderr :P
2009-05-28Avoid instance variables lookups in a critical pathEric Wong1-3/+4
Make us look even better in "Hello World" benchmarks! Passing a third parameter to avoid the constant lookup for the HttpRequest object doesn't seem to have a measurable effect.
2009-05-28Make our HttpRequest object a global constantEric Wong2-3/+8
This should be faster/cheaper than using an instance variable since it's accessed in a critical code path. Unicorn was never designed to be reentrant or thread-safe at all, either.
2009-05-28SIGHUP reloads app even if preload_app is trueEric Wong2-4/+5
This makes SIGHUP handling more consistent across different configurations, and allows togging preload_app to take effect when SIGHUP is issued.
2009-05-28Fix potential race condition in timeout handlingEric Wong1-8/+14
There is a potential race condition in closing the tempfile immediately after SIGKILL-ing the child. So instead just close it when we reap the dead child. Some some versions of Ruby may also not like having the WORKERS hash being changed while it is iterating through each_pair, so dup the hash to be on the safe side (should be cheap, since it's not a deep copy) since kill_worker() can modify the WORKERS hash. This is somewhat of a shotgun fix as I can't reproduce the problem consistently, but oh well.
2009-05-27doc: cleanup summary/descriptionEric Wong2-12/+10
2009-05-26unicorn 0.8.0 v0.8.0Eric Wong2-1/+2
2009-05-26remove trickletest from ManifestEric Wong1-1/+0
2009-05-25Switch to autoload to defer requiresEric Wong3-9/+9
This should prevent Rack from being required too early on so "-I" being passed through the unicorn command-line can modify $LOAD_PATH for Rack
2009-05-25Only refresh the gem list when building the appEric Wong1-4/+6
No point in refreshing the list of gems unless the app can actually be reloaded.
2009-05-25Refresh Gem list when building the appEric Wong1-0/+4
On application reloads, Gems installed by the Ruby instance may be different than when Unicorn started. So when preload_app is false, HUP-ing Unicorn will always refresh the list of Gems before loading the application code.
2009-05-22Merge commit 'v0.7.1'Eric Wong2-1/+2
* commit 'v0.7.1': unicorn 0.7.1 Conflicts: lib/unicorn/const.rb
2009-05-22unicorn 0.7.1 v0.7.1Eric Wong2-1/+2
2009-05-22Merge branch 'benchmark'Eric Wong2-0/+11
* benchmark: Define HttpRequest#reset if missing
2009-05-22Define HttpRequest#reset if missingEric Wong2-0/+11
Newer versions of Unicorn do not include a #reset method
2009-05-22Merge branch '0.7.x-stable'Eric Wong0-0/+0
* 0.7.x-stable: GNUmakefile: glob all files in bin/* Disable formatting for command-line switches test_response: correct OFS test http_response: allow string status codes Enforce minimum timeout at 3 seconds configurator: fix rdoc formatting Preserve 1.9 IO encodings in reopen_logs Fix a warning about @pid being uninitialized TUNING: add a note about somaxconn with UNIX sockets Ignore unhandled master signals in the workers Safer timeout handling and test case app/old_rails: correctly log errors in output Add TUNING document app/exec_cgi: GC prevention Add example init script test_upload: still uncomfortable with 1.9 IO encoding... test_request: enable with Ruby 1.9 now Rack 1.0.0 is out
2009-05-22GNUmakefile: glob all files in bin/*Eric Wong1-2/+4
Easier to maintain and add new executables this way
2009-05-22Disable formatting for command-line switchesEric Wong1-2/+2
Copy and pasting from the RDoc web page and passing "\342\200\224config-file" to the command-line does not work.
2009-05-22test_response: correct OFS testEric Wong1-1/+1
Must have multiple headers to test this effectively
2009-05-22http_response: allow string status codesEric Wong2-1/+9
Rack::Lint says they just have to work when to_i is called on the status, so that's what we'll do.
2009-05-22Enforce minimum timeout at 3 secondsEric Wong1-2/+2
2 seconds is still prone to race conditions under high load. We're intentionally less accurate than we could be in order to reduce syscall and method dispatch overhead.
2009-05-22configurator: fix rdoc formattingEric Wong1-19/+19
2009-05-22Preserve 1.9 IO encodings in reopen_logsEric Wong3-5/+98
Ensure we preserve both internal and external encodings when reopening logs.
2009-05-22Fix a warning about @pid being uninitializedEric Wong1-0/+1
2009-05-22TUNING: add a note about somaxconn with UNIX socketsEric Wong1-0/+4
2009-05-22Ignore unhandled master signals in the workersEric Wong1-1/+1
This makes it easier to use "killall -$SIGNAL unicorn" without having to lookup the correct PID.
2009-05-22Safer timeout handling and test caseEric Wong3-7/+6
Timeouts of less than 2 seconds are unsafe due to the lack of subsecond resolution in most POSIX filesystems. This is the trade-off for using a low-complexity solution for timeouts. Since this type of timeout is a last resort; 2 seconds is not entirely unreasonable IMNSHO. Additionally, timing out too aggressively can put us in a fork loop and slow down the system. Of course, the default is 60 seconds and most people do not bother to change it.
2009-05-22app/old_rails: correctly log errors in outputEric Wong1-2/+2
"out" was an invalid variable in that context...
2009-05-22Add TUNING documentEric Wong3-0/+62
Most of this should be applicable to Mongrel and other web servers, too.
2009-05-22app/exec_cgi: GC preventionEric Wong1-3/+3
Don't allow newly created IO objects to get GC'ed and subsequently close(2)-ed. We're not reopening the {$std,STD}{in,out,err} variables since those can't be trusted to have fileno 1, 2 and 3 respectively.
2009-05-22Add example init scriptEric Wong1-0/+54
This was done in Bourne shell because it's easier for UNIX sysadmins who don't know Ruby to understand and modify. Additionally, it can be used for nginx or anything else that shares compatible signal handling.
2009-05-22test_upload: still uncomfortable with 1.9 IO encoding...Eric Wong1-0/+18
It seems most applications use buffered IO#read instead of IO#sysread. So make sure our encoding is set correctly for buffered IO#read applications, too.
2009-05-22test_request: enable with Ruby 1.9 now Rack 1.0.0 is outEric Wong1-5/+0
2009-05-21GNUmakefile: glob all files in bin/*Eric Wong1-2/+4
Easier to maintain and add new executables this way
2009-05-21Disable formatting for command-line switchesEric Wong1-2/+2
Copy and pasting from the RDoc web page and passing "\342\200\224config-file" to the command-line does not work.
2009-05-13privatize constants only used by old_rails/staticEric Wong2-11/+6
Unicorn proper no longer needs these constants, so don't bother with them.
2009-05-13test_response: correct OFS testEric Wong1-1/+1
Must have multiple headers to test this effectively
2009-05-13http_response: allow string status codesEric Wong2-1/+9
Rack::Lint says they just have to work when to_i is called on the status, so that's what we'll do.
2009-05-13Require Rack for HTTP Status codesEric Wong3-47/+10
Preventing needless duplication since Rack already has these codes for us. Also, put the status codes in HttpResponse since nothing else needs (or should need) them.