* [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; 4+ 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; 4+ 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 1/3] generate response status strings dynamically
2015-06-30 3:01 6% [PATCH 0/3] favor newer Rubies for performance Eric Wong
@ 2015-06-30 3:01 7% ` Eric Wong
0 siblings, 0 replies; 4+ results
From: Eric Wong @ 2015-06-30 3:01 UTC (permalink / raw)
To: yahns-public; +Cc: e
Rack::Utils::HTTP_STATUS_CODES may be altered by the underlying
application, allow changes to that to be reflected in our responses
and do not rely on the Unicorn::HttpResponse::CODES hash which
will probably go away soon.
---
lib/yahns/http_response.rb | 8 +++++---
lib/yahns/proxy_http_response.rb | 11 ++++++-----
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/lib/yahns/http_response.rb b/lib/yahns/http_response.rb
index fabd4b7..b70491d 100644
--- a/lib/yahns/http_response.rb
+++ b/lib/yahns/http_response.rb
@@ -59,7 +59,7 @@ module Yahns::HttpResponse # :nodoc:
end
def err_response(code)
- "#{response_start}#{CODES[code]}\r\n\r\n"
+ "#{response_start}#{code} #{Rack::Utils::HTTP_STATUS_CODES[code]}\r\n\r\n"
end
def response_header_blocked(ret, header, body, alive, offset, count)
@@ -130,7 +130,6 @@ module Yahns::HttpResponse # :nodoc:
# writes the rack_response to socket as an HTTP response
# returns :wait_readable, :wait_writable, :forget, or nil
def http_response_write(status, headers, body)
- status = CODES[status.to_i] || status
offset = 0
count = hijack = nil
k = self.class
@@ -138,7 +137,10 @@ module Yahns::HttpResponse # :nodoc:
flags = MSG_DONTWAIT
if @hs.headers?
- buf = "#{response_start}#{status}\r\nDate: #{httpdate}\r\n"
+ code = status.to_i
+ msg = Rack::Utils::HTTP_STATUS_CODES[code]
+ buf = "#{response_start}#{msg ? %Q(#{code} #{msg}) : status}\r\n" \
+ "Date: #{httpdate}\r\n"
headers.each do |key, value|
case key
when %r{\ADate\z}i
diff --git a/lib/yahns/proxy_http_response.rb b/lib/yahns/proxy_http_response.rb
index cbdce6f..61989c2 100644
--- a/lib/yahns/proxy_http_response.rb
+++ b/lib/yahns/proxy_http_response.rb
@@ -38,7 +38,8 @@ module Yahns::HttpResponse # :nodoc:
end
# try to write something, but don't care if we fail
Integer === code and
- kgio_trywrite("HTTP/1.1 #{CODES[code]}\r\n\r\n") rescue nil
+ kgio_trywrite("HTTP/1.1 #{code} #{
+ Rack::Utils::HTTP_STATUS_CODES[code]}\r\n\r\n") rescue nil
shutdown rescue nil
req_res.shutdown rescue nil
@@ -59,16 +60,16 @@ module Yahns::HttpResponse # :nodoc:
# returns nil if completely done
def proxy_response_start(res, tip, kcar, req_res)
status, headers = res
- si = status.to_i
- status = CODES[si] || status
+ code = status.to_i
+ msg = Rack::Utils::HTTP_STATUS_CODES[code]
env = @hs.env
- have_body = !Rack::Utils::STATUS_WITH_NO_ENTITY_BODY.include?(si) &&
+ have_body = !Rack::Utils::STATUS_WITH_NO_ENTITY_BODY.include?(code) &&
env[REQUEST_METHOD] != HEAD
flags = MSG_DONTWAIT
alive = @hs.next? && self.class.persistent_connections
response_headers = env['yahns.proxy_pass.response_headers']
- res = "HTTP/1.1 #{status}\r\n"
+ res = "HTTP/1.1 #{msg ? %Q(#{code} #{msg}) : status}\r\n"
headers.each do |key,value| # n.b.: headers is an Array of 2-element Arrays
case key
when /\A(?:Connection|Keep-Alive)\z/i
--
EW
^ permalink raw reply related [relevance 7%]
* [PATCH 0/3] favor newer Rubies for performance
@ 2015-06-30 3:01 6% Eric Wong
2015-06-30 3:01 7% ` [PATCH 1/3] generate response status strings dynamically Eric Wong
0 siblings, 1 reply; 4+ results
From: Eric Wong @ 2015-06-30 3:01 UTC (permalink / raw)
To: yahns-public; +Cc: e
* [PATCH 1/3] generate response status strings dynamically
This unfortunately introduces a minor performance regression.
However, it is unlikely to be noticeable in real-world apps.
* [PATCH 2/3] reduce constants and optimize for Ruby 2.2+
This appears to recover the performance lost in 1/3 when doing
informal benchmarks on a private app (persistent connections
enabled).
* [PATCH 3/3] http_response: reduce bytecode size
This generates less bytecode when checking with
RubyVM::InstructionSequence.compile
lib/yahns/http_client.rb | 16 +++++-----------
lib/yahns/http_response.rb | 35 ++++++++++++++++-------------------
lib/yahns/max_body.rb | 12 ++++--------
lib/yahns/proxy_http_response.rb | 16 +++++++++-------
4 files changed, 34 insertions(+), 45 deletions(-)
^ permalink raw reply [relevance 6%]
Results 1-4 of 4 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2015-06-30 3:01 6% [PATCH 0/3] favor newer Rubies for performance Eric Wong
2015-06-30 3:01 7% ` [PATCH 1/3] generate response status strings dynamically 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).