summary refs log tree commit homepage
AgeCommit message (Collapse)AuthorFilesLines
2015-05-20ISSUES: discourage HTML mail strongly, welcome nymsEric Wong1-1/+2
HTML email is too likely to be lost, so more strongly discourage it. While we're at it, make it clear we allow anonymous and pseudonymous contributions, unlike many projects nowadays.
2015-05-20process SIGWINCH unless stdin is a TTYEric Wong1-3/+3
Some process managers such as foreman and daemontools rely on unicorn not daemonizing, but we still want to be able to process SIGWINCH in that case. stdout and stderr may be redirected to a pipe (for cronolog or similar process), so those are less likely to be attached to a TTY than stdin. This also allows users to process SIGWINCH when running inside a regular terminal if they redirect stdin to /dev/null. Reported-by: Dan Moore <dan@vaporwa.re> References: <etPan.555b4293.5b47a5b7.e617@danbookpro> <20150519232858.GA23515@dcvr.yhbt.net>
2015-05-18FAQ: add note about ECONNRESET errors from bodiesEric Wong1-0/+9
Thanks to Michael Fischer and Gabe Martin-Dempesy for bringing this to light on the mailing list. Ref: <CABHxtY7Sn5yaiR5a3gDk1G4XySE+UtfuqUTcOSdmwneXLD5rcg@mail.gmail.com> Ref: <FC91211E-FD32-432C-92FC-0318714C2170@zendesk.com> Cc: Michael Fischer <mfischer@zendesk.com> Cc: Gabe Martin-Dempesy <gabe@zendesk.com>
2015-05-16avoid extra allocation for hijack proc creationEric Wong1-5/+11
proc creation is expensive, so merely use a 48-byte generic ivar hash slot for @socket instead.
2015-05-16http_request: support rack.hijack by defaultEric Wong1-23/+9
Rack 1.4 and earlier will soon die out, so avoid having extra code The only minor overhead is assigning two hash slots and the extra hash checks when running ancient versions of Rack, so it is unlikely anybody cares about that overhead with Rack 1.5 and later.
2015-05-16Merge tag 'v4.9.0'Eric Wong0-0/+0
unicorn 4.9.0 - TempfileReaper support in Rack 1.6 This release supports the Rack::TempfileReaper middleware found in rack 1.6 for cleaning up disk space used by temporary files. We also use Rack::TempfileReaper for cleaning up large temporary files buffered with TeeInput. Users on rack 1.5 and earlier will see no changes. There's also a bunch of documentation/build system improvements. This is likely to be the last Ruby 1.8-compatible release, unicorn 5.x will require 1.9.3 or later as well as dropping lots of cruft (the stupid "Status:" header in responses being the most notable). 21 changes backported from master: ISSUES: update with mailing list subscription FAQ: add entry for Rails autoflush_log dev: remove isolate dependency unicorn.gemspec: depend on test-unit 3.0 remove RubyForge and Freecode references remove mongrel.rubyforge.org references examples: add run_once to before_fork hook example t/t0002-parser-error.sh: relax test for rack 1.6.0 switch docs + website to olddoc README: clarify/reduce references to unicorn_rails gemspec: fixup olddoc migration GNUmakefile: fix clean gem build + reduce build cruft doc: update support status for Ruby versions fix uninstalled testing and reduce require paths test_socket_helper: do not depend on SO_REUSEPORT ISSUES: add section for bugs in other projects explain 11 byte magic number for self-pipe Links: mark Rainbows! as historical, reference yahns doc: document UNICORN_FD in manpage tee_input: support for Rack::TempfileReaper middleware support TempfileReaper in deployment and development envs * tag 'v4.9.0': (22 commits) unicorn 4.9.0 - TempfileReaper support in Rack 1.6 support TempfileReaper in deployment and development envs tee_input: support for Rack::TempfileReaper middleware doc: document UNICORN_FD in manpage Links: mark Rainbows! as historical, reference yahns explain 11 byte magic number for self-pipe ISSUES: add section for bugs in other projects test_socket_helper: do not depend on SO_REUSEPORT fix uninstalled testing and reduce require paths doc: update support status for Ruby versions GNUmakefile: fix clean gem build + reduce build cruft gemspec: fixup olddoc migration README: clarify/reduce references to unicorn_rails switch docs + website to olddoc t/t0002-parser-error.sh: relax test for rack 1.6.0 examples: add run_once to before_fork hook example remove mongrel.rubyforge.org references remove RubyForge and Freecode references unicorn.gemspec: depend on test-unit 3.0 dev: remove isolate dependency ...
2015-05-07favor kgio_wait_readable for single FD over selectEric Wong1-1/+1
kgio_wait_readable is superior for single FDs in that it may use the ppoll syscall on Linux via Ruby, making it immune to the slowdown high FDs with select() and the array allocations enforced by the Ruby wrapper interface. Note: IO#wait in the io/wait stdlib has the same effect, but as of 2.2 still needlessly checks the FIONREAD ioctl. So avoid needing to force a new require on users which also incur shared object loading costs. The longer term plan is to rely entirely on Ruby IO primitives entirely and drop kgio, but that won't happen until we can depend on Ruby 2.3 for exception-free accept_nonblock (which will be released December 2015).
2015-04-24unicorn 4.9.0 - TempfileReaper support in Rack 1.6 v4.9.0Eric Wong1-1/+1
This release supports the Rack::TempfileReaper middleware found in rack 1.6 for cleaning up disk space used by temporary files. We also use Rack::TempfileReaper for cleaning up large temporary files buffered with TeeInput. Users on rack 1.5 and earlier will see no changes. There's also a bunch of documentation/build system improvements. This is likely to be the last Ruby 1.8-compatible release, unicorn 5.x will require 1.9.3 or later as well as dropping lots of cruft (the stupid "Status:" header in responses being the most notable). 21 changes backported from master: ISSUES: update with mailing list subscription FAQ: add entry for Rails autoflush_log dev: remove isolate dependency unicorn.gemspec: depend on test-unit 3.0 remove RubyForge and Freecode references remove mongrel.rubyforge.org references examples: add run_once to before_fork hook example t/t0002-parser-error.sh: relax test for rack 1.6.0 switch docs + website to olddoc README: clarify/reduce references to unicorn_rails gemspec: fixup olddoc migration GNUmakefile: fix clean gem build + reduce build cruft doc: update support status for Ruby versions fix uninstalled testing and reduce require paths test_socket_helper: do not depend on SO_REUSEPORT ISSUES: add section for bugs in other projects explain 11 byte magic number for self-pipe Links: mark Rainbows! as historical, reference yahns doc: document UNICORN_FD in manpage tee_input: support for Rack::TempfileReaper middleware support TempfileReaper in deployment and development envs
2015-04-24support TempfileReaper in deployment and development envs 4.x-stableEric Wong1-0/+2
rack 1.6 added a TempfileReaper middleware to cleanup temporary files. Enable it by default for users running rack 1.6 or later to avoid leaving temporary files around.
2015-04-24tee_input: support for Rack::TempfileReaper middlewareEric Wong3-1/+21
Rack::TempfileReaper was added in rack 1.6 to cleanup temporary files. Make Unicorn::TmpIO ducktype-compatible so Rack::TempfileReaper may be used to free up space used by temporary buffer files. Ref: <CY1PR0301MB078011EB5A22B733EB222A45A4EE0@CY1PR0301MB0780.namprd03.prod.outlook.com> Reported-by: Mike Mulvaney <MMulvaney@bna.com>
2015-04-24support TempfileReaper in deployment and development envsEric Wong1-0/+2
rack 1.6 added a TempfileReaper middleware to cleanup temporary files. Enable it by default for users running rack 1.6 or later to avoid leaving temporary files around.
2015-04-24tee_input: support for Rack::TempfileReaper middlewareEric Wong3-1/+21
Rack::TempfileReaper was added in rack 1.6 to cleanup temporary files. Make Unicorn::TmpIO ducktype-compatible so Rack::TempfileReaper may be used to free up space used by temporary buffer files. Ref: <CY1PR0301MB078011EB5A22B733EB222A45A4EE0@CY1PR0301MB0780.namprd03.prod.outlook.com> Reported-by: Mike Mulvaney <MMulvaney@bna.com>
2015-04-22doc: document UNICORN_FD in manpageEric Wong1-0/+7
Due to the prevalence of socket activation in modern init systems, we shall document UNICORN_FD (previously an implementation detail) in the manpage.
2015-04-22Links: mark Rainbows! as historical, reference yahnsEric Wong1-1/+4
Pushing the boundaries of bad marketing :P
2015-04-22explain 11 byte magic number for self-pipeEric Wong1-0/+4
Oops, this should've been explained long ago but apparently not. In response to a comment on http://www.sitepoint.com/the-self-pipe-trick-explained/ > Does anybody know why both unicorn and foreman read 11 bytes from > self-pipe? Unfortunately I couldn't find a way to comment on the site on a JavaScript-free browser nor does it seem possible without registering. Again, anybody can send plain-text mail to: unicorn-public@bogomips.org No registration, no real name policy, no terms-of-service, just plain-text. Feel free to use Tor, mixmaster or any anonymity service, too.
2015-04-22ISSUES: add section for bugs in other projectsEric Wong1-1/+35
This is not anything new, just documenting what has been going on since the beginning. There's been a small number of generic networking (or mm) bugs in the kernel which affect unicorn, but are usually found and fixed with more popular, non-Ruby servers, first. Aside from generic performance problems, I don't think there's ever been a glibc bug which affected unicorn.
2015-04-22test_socket_helper: do not depend on SO_REUSEPORTEric Wong1-1/+1
Older Rubies (2.0) may not define SO_REUSEPORT even if the kernel and libc support it
2015-04-22fix uninstalled testing and reduce require pathsEric Wong12-14/+18
This fixes a bug introduced in commit fe83ead4eae6f011fa15f506cd80cb4256813a92 (GNUmakefile: fix clean gem build + reduce build cruft) which broke clean Ruby installations without an existing unicorn gem installed :x [fixed test/unit/test_http_parser_xftrust.rb for backport]
2015-04-22doc: update support status for Ruby versionsEric Wong9-96/+21
unicorn 5 will not support Ruby 1.8 anymore. Drop mentions of Rubinius, too, it's too difficult to support due to the proprietary and registration-required nature of its bug tracker. The smaller memory footprint and CoW-friendly memory allocator in mainline Ruby is a better fit for unicorn, anyways. Since Ruby 1.9+ bundles RubyGems and gem startup is faster nowadays, we'll just depend on that instead of not loading RubyGems. Drop the local.mk.sample file, too, since it's way out-of-date and probably isn't useful (I have not used it in a while). [reinstate 1.9 version check for listener_fds in backport]
2015-04-22GNUmakefile: fix clean gem build + reduce build cruftEric Wong1-7/+6
Ensure we have a NEWS file for building the gem beforehand. We don't need to polute lib/ with object files, either.
2015-04-22gemspec: fixup olddoc migrationEric Wong1-2/+0
rdoc_options is no longer necesary with olddoc as olddoc can infer document titles and only generates cgit-compatible URLs to source code.
2015-04-22README: clarify/reduce references to unicorn_railsEric Wong1-4/+3
unicorn_rails is an ancient compatibility wrapper for ancient versions of Rails which did not use Rack. Those applications have likely moved on, so stop promoting unicorn_rails.
2015-04-22switch docs + website to olddocEric Wong6-38/+28
wrongdoc was difficult to maintain because of the tidy-ffi dependency and the HTML5 changes in Darkfish could not be handled well by Tidy. olddoc is superior as it generates leaner HTML which loads faster, requires less scrolling and less processing power to render. Aesthetic comparisons are subjective of course but completely unimportant compared to speed and accessibility. The presence of images and CSS on the old (Darkfish-based) site probably set unreasonable expectations as to my ability and willingness to view such things. No more, the new website is entirely simple HTML which renders well with even the wimpiest browser.
2015-04-22t/t0002-parser-error.sh: relax test for rack 1.6.0Eric Wong1-3/+3
This overly zealous test was broken by: rack commit be28c6a2ac152fe4adfbef71f3db9f4200df89e8 ("update HTTP status codes to IETF RFC 7231")
2015-04-22examples: add run_once to before_fork hook exampleEric Wong1-0/+11
There may be code in a before_fork hook which should run only once, document an example using a guard variable since it may not be immediately obvious to all users. Inspired-by: BrĂ¡ulio Bhavamitra <braulio@eita.org.br> http://bogomips.org/unicorn-public/m/20141004015707.GA1951@dcvr.yhbt.net.html
2015-04-22remove mongrel.rubyforge.org referencesEric Wong4-8/+8
mongrel.rubyforge.org has been dead longer than rubyforge.org!
2015-04-22remove RubyForge and Freecode referencesEric Wong3-52/+0
Both sites are gone.
2015-04-22unicorn.gemspec: depend on test-unit 3.0Eric Wong1-0/+1
test-unit 3 and minitest 5 will have equal support status as a bundled gems when Ruby 2.2.0 is released in December 2014. These bundled gems will appear in the user-oriented tarball installations, but do not get installed by "make install" when installing Ruby from SVN or git. test-unit appears to be actively maintained and good at keeping backwards compatibility even on a major version change, so this means no code changes on our end. I am not convinced switching to minitest is worth the effort. Cc: Ken Dreyer <ktdreyer@ktdreyer.com>
2015-04-22dev: remove isolate dependencyEric Wong4-42/+2
It seems unnecessary with current versions of RubyGems supporting development dependencies.
2015-04-22FAQ: add entry for Rails autoflush_logEric Wong1-1/+9
Thanks to Cedric Maion for bringing this up on the mailing list: http://bogomips.org/unicorn-public/m/20140703144048.GA6674@cedric-maion.com
2015-04-22ISSUES: update with mailing list subscriptionEric Wong1-3/+9
mlmmj seems quite usable and maintainable, so we'll run it.
2015-04-07favor more string literals for cold call sitesEric Wong5-6/+6
Literal regexps cost over 450 bytes of memory per-site and unnecessary use of them costs memory in places where raw execution speed does not matter. Nowadays, we can rely on String#end_with? (introduced in 1.8.7) for improved readability, too.
2015-03-12doc: document Etc.nprocessors for worker_processesEric Wong1-3/+6
Ruby 2.2 has Etc.nprocessors, and using that (directly or as a factor) for setting worker_processes is often (but not always) appropriate.
2015-03-12doc: document UNICORN_FD in manpageEric Wong1-0/+7
Due to the prevalence of socket activation in modern init systems, we shall document UNICORN_FD (previously an implementation detail) in the manpage.
2015-03-02socket_helper: update commentsEric Wong1-3/+3
We had HTTPS support but dropped it(*) and some wacky servers out there do work better with TCP_DEFER_ACCEPT disabled. (*) No, we will not support HTTP/2, that is for nginx
2015-03-02http: remove experimental dechunk! methodEric Wong2-72/+0
It was never used anywhere AFAIK and wastes precious bytes.
2015-03-02http: remove deprecated reset methodEric Wong1-22/+0
We use the `clear' method everywhere nowadays.
2015-03-02save about 200 bytes of memory on x86-64Eric Wong1-2/+1
Empty classes do not need a heavy class definition scope.
2015-03-01Links: mark Rainbows! as historical, reference yahnsEric Wong1-1/+4
Pushing the boundaries of bad marketing :P
2015-03-01reduce and localize constant string useEric Wong3-25/+15
Literal String#freeze avoids allocations since Ruby 2.1 via the opt_str_freeze instruction, so we can start relying on it in some places as Ruby 2.1 adoption increases. The 100-continue handling is a good place to start since it is an uncommonly-used code path which benefits from size reduction and the negative performance impact is restricted to a handful of users. HTTP_RESPONSE_START can safely live in http_request.rb as its usage does not cross namespace boundaries The goal is to eventually eliminate Unicorn::Const entirely.
2015-03-01const: drop constants used by Rainbows!Eric Wong1-8/+0
Rainbows! (in maintenance mode) will need to define it's own constants in the future. We'll trim down our constant usage in subsequent commits as we take advantage of Ruby VM improvements.
2015-02-18explain 11 byte magic number for self-pipeEric Wong1-0/+4
Oops, this should've been explained long ago but apparently not. In response to a comment on http://www.sitepoint.com/the-self-pipe-trick-explained/ > Does anybody know why both unicorn and foreman read 11 bytes from > self-pipe? Unfortunately I couldn't find a way to comment on the site on a JavaScript-free browser nor does it seem possible without registering. Again, anybody can send plain-text mail to: unicorn-public@bogomips.org No registration, no real name policy, no terms-of-service, just plain-text. Feel free to use Tor, mixmaster or any anonymity service, too.
2015-02-12http_server: favor ivars over constantsEric Wong1-42/+35
In 1.9+ at least, instance variables use less space than constants in class tables and bytecode, leading to ~700 byte reduction in bytecode overhead on 64-bit and a reduction in constant table/entries of the Unicorn::HttpServer class.
2015-02-12ISSUES: add section for bugs in other projectsEric Wong1-1/+35
This is not anything new, just documenting what has been going on since the beginning. There's been a small number of generic networking (or mm) bugs in the kernel which affect unicorn, but are usually found and fixed with more popular, non-Ruby servers, first. Aside from generic performance problems, I don't think there's ever been a glibc bug which affected unicorn.
2015-02-06favor "a.b(&:c)" form over "a.b { |x| x.c }"Eric Wong1-2/+2
The former is shorter Ruby code and also generates smaller bytecode.
2015-02-06test_socket_helper: do not depend on SO_REUSEPORTEric Wong1-1/+1
Older Rubies (2.0) may not define SO_REUSEPORT even if the kernel and libc support it
2015-02-06fix uninstalled testing and reduce require pathsEric Wong11-13/+17
This fixes a bug introduced in commit fe83ead4eae6f011fa15f506cd80cb4256813a92 (GNUmakefile: fix clean gem build + reduce build cruft) which broke clean Ruby installations without an existing unicorn gem installed :x
2015-02-06doc: update support status for Ruby versionsEric Wong9-97/+22
unicorn 5 will not support Ruby 1.8 anymore. Drop mentions of Rubinius, too, it's too difficult to support due to the proprietary and registration-required nature of its bug tracker. The smaller memory footprint and CoW-friendly memory allocator in mainline Ruby is a better fit for unicorn, anyways. Since Ruby 1.9+ bundles RubyGems and gem startup is faster nowadays, we'll just depend on that instead of not loading RubyGems. Drop the local.mk.sample file, too, since it's way out-of-date and probably isn't useful (I have not used it in a while).
2015-02-05use require_relative to reduce syscalls at startupEric Wong2-12/+6
require_relative appeared in Ruby 1.9.2 to speed up load times by avoiding needless open() syscalls. This has no effect if you're using RUBYLIB or the '-I' option when running ruby(1), but avoids searching paths in other gems. This does not affect unicorn greatly as unicorn does not activate many gems, but still leads to reducing ~45 syscalls during startup.
2015-02-05favor IO#close_on_exec= over fcntl in 1.9+Eric Wong3-8/+5
IO#close_on_exec* methods are available since Ruby 1.9.1. It allows us to use less bytecode as it requires fewer operands and avoids constant lookups.