about summary refs log tree commit homepage
path: root/Documentation
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-08-03 02:57:15 +0000
committerEric Wong <e@80x24.org>2016-08-03 02:59:25 +0000
commitf1f430323bcab90bdbbe980d6ef5b60602796a55 (patch)
treef242391bf9bedc59434915cb063ea6bcd00f6dfe /Documentation
parentf770e5ba01bfcbc3c9f5c3eb12b28abdf6849f15 (diff)
downloadyahns-f1f430323bcab90bdbbe980d6ef5b60602796a55.tar.gz
We might as well do it since puma and thin both do(*),
and we can still do writev for now to get some speedups
by avoiding Rack::Chunked overhead.

timing runs of "curl --no-buffer http://127.0.0.1:9292/ >/dev/null"
results in a best case drop from ~260ms to ~205ms on one VM
by disabling Rack::Chunked in the below config.ru

$ ruby -I lib bin/yahns-rackup -E none config.ru

==> config.ru <==
class Body
  STR = ' ' * 1024 * 16
  def each
    10000.times { yield STR }
  end
end

use Rack::Chunked if ENV['RACK_CHUNKED']
run(lambda do |env|
  [ 200, [ %w(Content-Type text/plain) ], Body.new ]
end)

(*) they can do Content-Length, but I don't think it's
    worth the effort at the server level.
Diffstat (limited to 'Documentation')
0 files changed, 0 insertions, 0 deletions