unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [ANN] unicorn 5.1.0 - Rack HTTP server for fast clients and *nix
@ 2016-04-01  0:43  5% Eric Wong
  0 siblings, 0 replies; 4+ results
From: Eric Wong @ 2016-04-01  0:43 UTC (permalink / raw)
  To: ruby-talk, unicorn-public; +Cc: Adam Duke, Aaron Patterson

Unicorn is an HTTP server for Rack applications designed to only serve
fast clients on low-latency, high-bandwidth connections and take
advantage of features in Unix/Unix-like kernels.  Slow clients should
only be served by placing a reverse proxy capable of fully buffering
both the the request and response in between unicorn and slow clients.

* http://unicorn.bogomips.org/
* public list: unicorn-public@bogomips.org
* mail archives: http://bogomips.org/unicorn-public/
* git clone git://bogomips.org/unicorn.git
* http://unicorn.bogomips.org/NEWS.atom.xml
* nntp://news.public-inbox.org/inbox.comp.lang.ruby.unicorn

Changes:

    unicorn 5.1.0 - rack is optional, again

    Note: no code changes since 5.1.0.pre1 from January.^WNo, wait,
    last minute performance improvement added today.  See below.

    The big change is rack is not required (but still recommended).
    Applications are expected to depend on rack on their own so they can
    specify the version of rack they prefer without unicorn pulling
    in a newer, potentially incompatible version.

    unicorn will always attempt to work with multiple versions of rack
    as practical.

    The HTTP parser also switched to using the TypedData C-API for
    extra type safety and memory usage accounting support in the
    'objspace' extension.

    Thanks to Adam Duke to bringing the rack change to our attention
    and Aaron Patterson for helping with the matter.

    Last minute change: we now support the new leftpad() syscall under
    Linux for major performance and security improvements:

        http://mid.gmane.org/1459463613-32473-1-git-send-email-richard@nod.at

    8^H9 changes since 5.0.1:

          http: TypedData C-API conversion
          various documentation updates
          doc: bump olddoc to ~> 1.2 for extra NNTP URL
          rack is optional at runtime, required for dev
          doc update for ClientShutdown exceptions class
          unicorn 5.1.0.pre1 - rack is optional, again
          doc: reference --keep-file-descriptors for "bundle exec"
          doc: further trimming to reduce noise
          use leftpad Linux syscall for speed!

^ permalink raw reply	[relevance 5%]

* Re: [PATCH] doc: reference --keep-file-descriptors for "bundle exec"
  2016-03-17 13:09 12%                 ` Amir Yalon
@ 2016-03-17 16:37  9%                   ` Eric Wong
  0 siblings, 0 replies; 4+ results
From: Eric Wong @ 2016-03-17 16:37 UTC (permalink / raw)
  To: Amir Yalon; +Cc: Christos Trochalakis, unicorn-public

Amir Yalon <amiryal@yxejamir.net> wrote:
> Small correction: it’s `/usr/bin/bundle exec --keep-file-descriptors
> unicorn`, not `bundle exec --keep-file-descriptiors /usr/bin/unicorn`
> (first argument to ExecStart must be a full path.)

Ah, thanks!  Amended and pushed.

^ permalink raw reply	[relevance 9%]

* Re: [PATCH] doc: reference --keep-file-descriptors for "bundle exec"
  2016-03-17  0:27 18%               ` [PATCH] doc: reference --keep-file-descriptors for "bundle exec" Eric Wong
@ 2016-03-17 13:09 12%                 ` Amir Yalon
  2016-03-17 16:37  9%                   ` Eric Wong
  0 siblings, 1 reply; 4+ results
From: Amir Yalon @ 2016-03-17 13:09 UTC (permalink / raw)
  To: Eric Wong; +Cc: Christos Trochalakis, unicorn-public

> [Service]
> +# bundler users must use the "--keep-file-descriptors" switch, here:
> +# ExecStart = bundle exec --keep-file-descriptors /usr/bin/unicorn ...
 
Small correction: it’s `/usr/bin/bundle exec --keep-file-descriptors
unicorn`, not `bundle exec --keep-file-descriptiors /usr/bin/unicorn`
(first argument to ExecStart must be a full path.)

^ permalink raw reply	[relevance 12%]

* [PATCH] doc: reference --keep-file-descriptors for "bundle exec"
  @ 2016-03-17  0:27 18%               ` Eric Wong
  2016-03-17 13:09 12%                 ` Amir Yalon
  0 siblings, 1 reply; 4+ results
From: Eric Wong @ 2016-03-17  0:27 UTC (permalink / raw)
  To: Amir Yalon; +Cc: Christos Trochalakis, unicorn-public

Amir Yalon <amiryal@yxejamir.net> wrote:
> It became obvious that RVM is not to blame, and the real culprit was
> Bundler’s `bundle exec` script.  From here it was just a matter of
> figuring out how to launch the unicorn script from within the bundle
> using the correct ruby without calling `bundle exec`.  There are a
> number of ways to do that, here is what worked for me:

Ahah, seems like an old problem with bundler defaults.

> ExecStart = /usr/local/rvm/gems/ruby-2.0.0-p645/wrappers/ruby -r
> bundler/setup vendor/bundle/ruby/2.0.0/bin/unicorn -c
> config/unicorn/unicorn.rb -E staging -s myapp@%i

Actually, "bundle exec --keep-file-descriptors" should work
nowadays.  See patch below.

> Thanks again to all participants, your input was invaluable.

No problem.

> P.S.  Notice how I abuse the -s no-op parameter to identify which
> template instance is running in systemd (in the output of ps, for
> example), maybe worth documenting it as a feature?

*shrug* I prefer to use full the full path to the config file
which would already include the app name in it:

	unicorn -c /path/to/my_app/unicorn.conf.rb ...

-------------------------8<-------------------------
Subject: [PATCH] doc: reference --keep-file-descriptors for "bundle exec"

"bundle exec" alone is not suitable for use with systemd-style
socket activation due to Ruby 2.0+ behavior of setting close-on-exec
for file descriptors above 2.  However, the "--keep-file-descriptors"
option was added to bundler 1.4.0 to workaround this Ruby 2.0 change
and may be used to prevent Ruby 2.0+ from closing file descriptors
on exec.

Thanks to Amir Yalon and Christos Trochalakis for bringing up
this issue on the mailing list:

http://bogomips.org/unicorn-public/1457824748.3666627.547425122.2A828B07@webmail.messagingengine.com/
---
 Sandbox                   | 6 +++---
 examples/unicorn@.service | 2 ++
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/Sandbox b/Sandbox
index 997b92f..0760065 100644
--- a/Sandbox
+++ b/Sandbox
@@ -63,9 +63,9 @@ before_exec hook as illustrated by https://gist.github.com/534668
 === Ruby 2.0.0 close-on-exec and SIGUSR2 incompatibility
 
 Ruby 2.0.0 enforces FD_CLOEXEC on file descriptors by default.  unicorn
-has been prepared for this behavior since unicorn 4.1.0, but we forgot
-to remind the Bundler developers.  This issue is being tracked here:
-https://github.com/bundler/bundler/issues/2628
+has been prepared for this behavior since unicorn 4.1.0, and bundler
+needs the "--keep-file-descriptors" option for "bundle exec":
+http://bundler.io/man/bundle-exec.1.html
 
 == Isolate
 
diff --git a/examples/unicorn@.service b/examples/unicorn@.service
index b058da5..5b16b5b 100644
--- a/examples/unicorn@.service
+++ b/examples/unicorn@.service
@@ -11,6 +11,8 @@ Wants = unicorn.socket
 After = unicorn.socket
 
 [Service]
+# bundler users must use the "--keep-file-descriptors" switch, here:
+# ExecStart = bundle exec --keep-file-descriptors /usr/bin/unicorn ...
 ExecStart = /usr/bin/unicorn -c /path/to/unicorn.conf.rb /path/to/config.ru
 Sockets = unicorn.socket
 KillSignal = SIGQUIT
-- 
EW


^ permalink raw reply related	[relevance 18%]

Results 1-4 of 4 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2016-03-07 23:08     Systemd socket inheritance fails with “not a socket file descriptor” Amir Yalon
2016-03-08  3:31     ` Eric Wong
2016-03-08  7:45       ` Amir Yalon
2016-03-08 17:39         ` Eric Wong
2016-03-08 20:32           ` Amir Yalon
2016-03-09  3:51             ` Eric Wong
2016-03-09 14:06               ` Christos Trochalakis
2016-03-12 23:19                 ` Amir Yalon
2016-03-17  0:27 18%               ` [PATCH] doc: reference --keep-file-descriptors for "bundle exec" Eric Wong
2016-03-17 13:09 12%                 ` Amir Yalon
2016-03-17 16:37  9%                   ` Eric Wong
2016-04-01  0:43  5% [ANN] unicorn 5.1.0 - Rack HTTP server for fast clients and *nix Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).