yahns Ruby server user/dev discussion
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [ANN] yahns 1.10.0 -_- sleepy app server for Ruby
       [not found]     <20151101-yahns-1.10.0-rele@sed>
@ 2015-11-01  9:25  6% ` Eric Wong
  0 siblings, 0 replies; 3+ results
From: Eric Wong @ 2015-11-01  9:25 UTC (permalink / raw)
  To: ruby-talk, yahns-public

A Free Software, multi-threaded, non-blocking network application server
designed for low _idle_ power consumption.  It is primarily optimized
for applications with occasional users which see little or no traffic.
yahns currently hosts Rack/HTTP applications, but may eventually support
other application types.  Unlike some existing servers, yahns is
extremely sensitive to fatal bugs in the applications it hosts.

minor updates

  This release improves socket inheritance support.  TCP socket
  options are now applied to inherited sockets.  We also emulate
  the sd_listen_fds function to allow inheriting sockets from
  systemd.

  HTTP status strings are now generated dynamically, allowing
  applications to modify Rack::Utils::HTTP_STATUS_CODES to
  apply changes in the Rack response.  Unfortunately, this leads
  to minor (likely unnoticeable) performance regressions.

  However, our code is not optimized for Ruby 2.2+, so users on
  the latest released Ruby will benefit from reduced inline cache
  and constant lookups as we reduced our constant footprint.
  Expect further minor performance regressions if you are running
  Ruby 2.2 and earlier.

  For Ruby 2.2 users, overall performance should be largely
  unchanged from 1.7.0 to 1.8.0

  shortlog of changes since 1.7.0:

  * use opt_str_freeze for Hash#delete
  * test/helper: warn atomically
  * generate response status strings dynamically
  * reduce constants and optimize for Ruby 2.2+
  * http_response: reduce bytecode size
  * apply TCP socket options on inherited sockets
  * test/test_rack_hijack.rb: try to increase test reliability
  * emulate sd_listen_fds for systemd support
  * test/test_rack_hijack: ensure proper ordering of log messages

Since I'm also the BDFL of unicorn, questions comparing the two may be
inevitable.  In short, they are complete opposites in implementation.
More will be posted in the following thread, but for now there's an
incomplete overview:

  http://yhbt.net/yahns-public/20151101092053.GA5328@dcvr.yhbt.net/t/

Please note the disclaimer:

  yahns is extremely sensitive to fatal bugs in the apps it hosts.  There
  is no (and never will be) any built-in "watchdog"-type feature to kill
  stuck processes/threads.  Each yahns process may be handling thousands
  of clients; unexpectedly killing the process will abort _all_ of those
  connections.  Lives may be lost!

  yahns hackers are not responsible for your application/library bugs.
  Use an application server which is tolerant of buggy applications
  if you cannot be bothered to fix all your fatal bugs.

* git clone git://yhbt.net/yahns
* http://yahns.yhbt.net/README
* http://yahns.yhbt.net/NEWS.atom.xml
* we only accept plain-text email yahns-public@yhbt.net
* and archive all the mail we receive: http://yhbt.net/yahns-public/
* nntp://news.public-inbox.org/inbox.comp.lang.ruby.yahns

-- 
EW

^ permalink raw reply	[relevance 6%]

* [ANN] yahns 1.9.0 -_- sleepy app server for Ruby
@ 2015-07-21 20:39  6% Eric Wong
  0 siblings, 0 replies; 3+ results
From: Eric Wong @ 2015-07-21 20:39 UTC (permalink / raw)
  To: ruby-talk, yahns-public

A Free Software, multi-threaded, non-blocking network application server
designed for low _idle_ power consumption.  It is primarily optimized
for applications with occasional users which see little or no traffic.
yahns currently hosts Rack/HTTP applications, but may eventually support
other application types.  Unlike some existing servers, yahns is
extremely sensitive to fatal bugs in the applications it hosts.

minor updates

  This release improves socket inheritance support.  TCP socket
  options are now applied to inherited sockets.  We also emulate
  the sd_listen_fds function to allow inheriting sockets from
  systemd.

  HTTP status strings are now generated dynamically, allowing
  applications to modify Rack::Utils::HTTP_STATUS_CODES to
  apply changes in the Rack response.  Unfortunately, this leads
  to minor (likely unnoticeable) performance regressions.

  However, our code is not optimized for Ruby 2.2+, so users on
  the latest released Ruby will benefit from reduced inline cache
  and constant lookups as we reduced our constant footprint.
  Expect further minor performance regressions if you are running
  Ruby 2.2 and earlier.

  For Ruby 2.2 users, overall performance should be largely
  unchanged from 1.7.0 to 1.8.0

  shortlog of changes since 1.7.0:

  * use opt_str_freeze for Hash#delete
  * test/helper: warn atomically
  * generate response status strings dynamically
  * reduce constants and optimize for Ruby 2.2+
  * http_response: reduce bytecode size
  * apply TCP socket options on inherited sockets
  * test/test_rack_hijack.rb: try to increase test reliability
  * emulate sd_listen_fds for systemd support
  * test/test_rack_hijack: ensure proper ordering of log messages

Please note the disclaimer:

  yahns is extremely sensitive to fatal bugs in the apps it hosts.  There
  is no (and never will be) any built-in "watchdog"-type feature to kill
  stuck processes/threads.  Each yahns process may be handling thousands
  of clients; unexpectedly killing the process will abort _all_ of those
  connections.  Lives may be lost!

  yahns hackers are not responsible for your application/library bugs.
  Use an application server which is tolerant of buggy applications
  if you cannot be bothered to fix all your fatal bugs.

* git clone git://yhbt.net/yahns
* http://yahns.yhbt.net/README
* http://yahns.yhbt.net/NEWS.atom.xml
* we only accept plain-text email yahns-public@yhbt.net
* and archive all the mail we receive: http://yhbt.net/yahns-public/

-- 
EW

^ permalink raw reply	[relevance 6%]

* [PATCH] apply TCP socket options on inherited sockets
@ 2015-07-15 18:50  7% Eric Wong
  0 siblings, 0 replies; 3+ results
From: Eric Wong @ 2015-07-15 18:50 UTC (permalink / raw)
  To: yahns-public

TCP socket options are now set when inheriting existing sockets from
a parent process.  I'm fairly certain all the TCP setsockopt knobs
we use are idempotent and harmless to change.

If anything, the only directive I'd be uncomfortable changing is
shortening the listen(2) (aka :backlog) size, but we've always
changed that anyways since it also applies to UNIX sockets.

Note: removing a configuration knob in a yahns config file can not
reset the value to the OS-provided default setting.  Inherited
sockets must use a new setting to override existing ones.
(or the socket needs to be closed and re-created in the process
 launcher before yahns inherits it).

Based on unicorn commit 1db9a8243d42cc86d5ca4901bceb305061d0d212

Noticed-by: Christos Trochalakis <yatiohi@ideopolis.gr>
  <20150626114129.GA25883@luke.ws.skroutz.gr>
---
 lib/yahns/server.rb |  3 ++-
 test/test_server.rb | 20 ++++++++++++++++++++
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/lib/yahns/server.rb b/lib/yahns/server.rb
index 3b9addc..b6663e1 100644
--- a/lib/yahns/server.rb
+++ b/lib/yahns/server.rb
@@ -315,9 +315,10 @@ class Yahns::Server # :nodoc:
     inherited = ENV['YAHNS_FD'].to_s.split(',').map! do |fd|
       io = Socket.for_fd(fd.to_i)
       opts = sock_opts(io)
+      io = server_cast(io, opts)
       set_server_sockopt(io, opts)
       @logger.info "inherited addr=#{sock_name(io)} fd=#{fd}"
-      server_cast(io, opts)
+      io
     end
 
     @listeners.replace(inherited)
diff --git a/test/test_server.rb b/test/test_server.rb
index 0410f65..50e739a 100644
--- a/test/test_server.rb
+++ b/test/test_server.rb
@@ -845,4 +845,24 @@ class TestServer < Testcase
   ensure
     quit_wait(pid)
   end
+
+  def test_inherit_tcp_nodelay_set
+    err = @err
+    cfg = Yahns::Config.new
+    host, port = @srv.addr[3], @srv.addr[1]
+    @srv.setsockopt(:IPPROTO_TCP, :TCP_NODELAY, 0)
+    assert_equal 0, @srv.getsockopt(:IPPROTO_TCP, :TCP_NODELAY).int
+    cfg.instance_eval do
+      ru = lambda { |_| [ 200, { 'Content-Length' => '2' } , [ 'HI' ] ] }
+      GTL.synchronize { app(:rack, ru) { listen "#{host}:#{port}" } }
+      logger(Logger.new(err.path))
+    end
+    pid = mkserver(cfg, @srv) { ENV["YAHNS_FD"] = "#{@srv.fileno}" }
+    run_client(host, port) { |res| assert_equal "HI", res.body }
+
+    # TCP socket option is shared at file level, not FD level:
+    assert_equal 1, @srv.getsockopt(:IPPROTO_TCP, :TCP_NODELAY).int
+  ensure
+    quit_wait(pid)
+  end
 end
-- 
EW


^ permalink raw reply related	[relevance 7%]

Results 1-3 of 3 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2015-07-15 18:50  7% [PATCH] apply TCP socket options on inherited sockets Eric Wong
2015-07-21 20:39  6% [ANN] yahns 1.9.0 -_- sleepy app server for Ruby Eric Wong
     [not found]     <20151101-yahns-1.10.0-rele@sed>
2015-11-01  9:25  6% ` [ANN] yahns 1.10.0 " Eric Wong

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

	https://yhbt.net/yahns.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).