* [ANN] unicorn 5.0.0.pre1 - incompatible changes!
@ 2015-06-15 22:56 5% Eric Wong
0 siblings, 0 replies; 4+ results
From: Eric Wong @ 2015-06-15 22:56 UTC (permalink / raw)
To: unicorn-public
This release finally drops Ruby 1.8 support and requires Ruby 1.9.3
or later. The horrible "Status:" header in our HTTP response is
finally gone, saving at least 16 precious bytes in every single HTTP
response.
Under Ruby 2.1 and later, the monotonic clock is used for timeout
handling for better accuracy.
Several experimental, unused and undocumented features are removed.
There's also tiny, minor performance and memory improvements from
dropping 1.8 compatibility, but probably nothing noticeable on a
typical real-life (bloated) app.
The biggest performance improvement we made was to our website by
switching to olddoc. Depending on connection speed, latency, and
renderer performance, it typically loads two to four times faster.
Finally, for the billionth time: unicorn must never be exposed
to slow clients, as it will never ever use new-fangled things
like non-blocking socket I/O, threads, epoll or kqueue. unicorn
must be used with a fully-buffering reverse proxy such as nginx
for slow clients.
I'll tag 5.0.0 final in a week or so if all goes well
= gem install --pre unicorn
= git clone git://bogomips.org/unicorn.git
= http://unicorn.bogomips.org/
* ISSUES: update with mailing list subscription
* GIT-VERSION-GEN: start 5.0.0 development
* http: remove xftrust options
* FAQ: add entry for Rails autoflush_log
* dev: remove isolate dependency
* unicorn.gemspec: depend on test-unit 3.0
* http_response: remove Status: header
* remove RubyForge and Freecode references
* remove mongrel.rubyforge.org references
* http: remove the keepalive requests limit
* http: reduce parser from 72 to 56 bytes on 64-bit
* examples: add run_once to before_fork hook example
* worker: remove old tmp accessor
* http_server: save 450+ bytes of memory on x86-64
* t/t0002-parser-error.sh: relax test for rack 1.6.0
* remove SSL support
* tmpio: drop the "size" method
* switch docs + website to olddoc
* README: clarify/reduce references to unicorn_rails
* gemspec: fixup olddoc migration
* use the monotonic clock under Ruby 2.1+
* http: -Wshorten-64-to-32 warnings on clang
* remove old inetd+git examples and exec_cgi
* http: standalone require + reduction in binary size
* GNUmakefile: fix clean gem build + reduce build cruft
* socket_helper: reduce constant lookups and caching
* remove 1.8, <= 1.9.1 fallback for missing IO#autoclose=
* favor IO#close_on_exec= over fcntl in 1.9+
* use require_relative to reduce syscalls at startup
* doc: update support status for Ruby versions
* fix uninstalled testing and reduce require paths
* test_socket_helper: do not depend on SO_REUSEPORT
* favor "a.b(&:c)" form over "a.b { |x| x.c }"
* ISSUES: add section for bugs in other projects
* http_server: favor ivars over constants
* explain 11 byte magic number for self-pipe
* const: drop constants used by Rainbows!
* reduce and localize constant string use
* Links: mark Rainbows! as historical, reference yahns
* save about 200 bytes of memory on x86-64
* http: remove deprecated reset method
* http: remove experimental dechunk! method
* socket_helper: update comments
* doc: document UNICORN_FD in manpage
* doc: document Etc.nprocessors for worker_processes
* favor more string literals for cold call sites
* tee_input: support for Rack::TempfileReaper middleware
* support TempfileReaper in deployment and development envs
* favor kgio_wait_readable for single FD over select
* Merge tag 'v4.9.0'
* http_request: support rack.hijack by default
* avoid extra allocation for hijack proc creation
* FAQ: add note about ECONNRESET errors from bodies
* process SIGWINCH unless stdin is a TTY
* ISSUES: discourage HTML mail strongly, welcome nyms
* http: use rb_hash_clear in Ruby 2.0+
* http_response: avoid special-casing for Rack < 1.5
* www: install NEWS.atom.xml properly
* http_server: remove a few more accessors and constants
* http_response: simplify regular expression
* move the socket into Rack env for hijacking
* http: move response_start_sent into the C ext
* FAQ: reorder bit on Rack 1.1.x and Rails 2.3.x
* ensure body is closed during hijack
--
EW
^ permalink raw reply [relevance 5%]
* [ANN] unicorn 4.9.0 - Rack HTTP server for fast clients and *nix
@ 2015-04-24 3:17 6% Eric Wong
0 siblings, 0 replies; 4+ results
From: Eric Wong @ 2015-04-24 3:17 UTC (permalink / raw)
To: ruby-talk; +Cc: unicorn-public, Mike Mulvaney
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
Changes:
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
--
EW
^ permalink raw reply [relevance 6%]
* [PATCH 0/2] Rack::TempfileReaper support
@ 2015-04-24 3:02 7% Eric Wong
2015-04-24 3:02 7% ` [PATCH 1/2] tee_input: support for Rack::TempfileReaper middleware Eric Wong
0 siblings, 1 reply; 4+ results
From: Eric Wong @ 2015-04-24 3:02 UTC (permalink / raw)
To: unicorn-public; +Cc: Mike Mulvaney
These will be in the upcoming 4.9 release, as well as the 5.x
release which drops old cruft and 1.8 support. I've decided
to use 4.9 instead of 4.8.4 since this does change the feature
set slightly.
Eric Wong (2):
tee_input: support for Rack::TempfileReaper middleware
support TempfileReaper in deployment and development envs
lib/unicorn.rb | 2 ++
lib/unicorn/tee_input.rb | 9 ++++++++-
lib/unicorn/tmpio.rb | 3 +++
test/unit/test_tee_input.rb | 10 ++++++++++
4 files changed, 23 insertions(+), 1 deletion(-)
^ permalink raw reply [relevance 7%]
* [PATCH 1/2] tee_input: support for Rack::TempfileReaper middleware
2015-04-24 3:02 7% [PATCH 0/2] Rack::TempfileReaper support Eric Wong
@ 2015-04-24 3:02 7% ` Eric Wong
0 siblings, 0 replies; 4+ results
From: Eric Wong @ 2015-04-24 3:02 UTC (permalink / raw)
To: unicorn-public; +Cc: Mike Mulvaney, Eric Wong
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>
---
lib/unicorn/tee_input.rb | 9 ++++++++-
lib/unicorn/tmpio.rb | 3 +++
test/unit/test_tee_input.rb | 10 ++++++++++
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/lib/unicorn/tee_input.rb b/lib/unicorn/tee_input.rb
index 637c583..3c6d18a 100644
--- a/lib/unicorn/tee_input.rb
+++ b/lib/unicorn/tee_input.rb
@@ -28,13 +28,20 @@ class Unicorn::TeeInput < Unicorn::StreamInput
@@client_body_buffer_size
end
+ # for Rack::TempfileReaper in rack 1.6+
+ def new_tmpio # :nodoc:
+ tmpio = Unicorn::TmpIO.new
+ (@parser.env['rack.tempfiles'] ||= []) << tmpio
+ tmpio
+ end
+
# Initializes a new TeeInput object. You normally do not have to call
# this unless you are writing an HTTP server.
def initialize(socket, request)
@len = request.content_length
super
@tmp = @len && @len <= @@client_body_buffer_size ?
- StringIO.new("") : Unicorn::TmpIO.new
+ StringIO.new("") : new_tmpio
end
# :call-seq:
diff --git a/lib/unicorn/tmpio.rb b/lib/unicorn/tmpio.rb
index c97979a..db88ed3 100644
--- a/lib/unicorn/tmpio.rb
+++ b/lib/unicorn/tmpio.rb
@@ -21,4 +21,7 @@ class Unicorn::TmpIO < File
fp.sync = true
fp
end
+
+ # pretend we're Tempfile for Rack::TempfileReaper
+ alias close! close
end
diff --git a/test/unit/test_tee_input.rb b/test/unit/test_tee_input.rb
index 0c2c941..4647e66 100644
--- a/test/unit/test_tee_input.rb
+++ b/test/unit/test_tee_input.rb
@@ -29,6 +29,13 @@ class TestTeeInput < Test::Unit::TestCase
end while true
end
+ def check_tempfiles
+ tmp = @parser.env["rack.tempfiles"]
+ assert_instance_of Array, tmp
+ assert_operator tmp.size, :>=, 1
+ assert_instance_of Unicorn::TmpIO, tmp[0]
+ end
+
def test_gets_long
r = init_request("hello", 5 + (4096 * 4 * 3) + "#$/foo#$/".size)
ti = TeeInput.new(@rd, r)
@@ -106,6 +113,7 @@ class TestTeeInput < Test::Unit::TestCase
assert_kind_of File, ti.tmp
assert_equal 0, ti.tmp.pos
assert_equal Unicorn::Const::MAX_BODY + 1, ti.size
+ check_tempfiles
end
def test_read_in_full_if_content_length
@@ -148,6 +156,7 @@ class TestTeeInput < Test::Unit::TestCase
assert_nil ti.read(1)
pid, status = Process.waitpid2(pid)
assert status.success?
+ check_tempfiles
end
def test_chunked
@@ -183,6 +192,7 @@ class TestTeeInput < Test::Unit::TestCase
status = nil
pid, status = Process.waitpid2(pid)
assert status.success?
+ check_tempfiles
end
def test_chunked_ping_pong
--
EW
^ permalink raw reply related [relevance 7%]
Results 1-4 of 4 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2015-04-24 3:02 7% [PATCH 0/2] Rack::TempfileReaper support Eric Wong
2015-04-24 3:02 7% ` [PATCH 1/2] tee_input: support for Rack::TempfileReaper middleware Eric Wong
2015-04-24 3:17 6% [ANN] unicorn 4.9.0 - Rack HTTP server for fast clients and *nix Eric Wong
2015-06-15 22:56 5% [ANN] unicorn 5.0.0.pre1 - incompatible changes! 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).