* Re: [RFC/PATCH] check_client_connection: document local-only requirement
2012-11-29 21:55 5% ` [RFC/PATCH] check_client_connection: document local-only requirement Eric Wong
@ 2012-11-29 23:47 7% ` Tom Burns
0 siblings, 0 replies; 2+ results
From: Tom Burns @ 2012-11-29 23:47 UTC (permalink / raw)
To: unicorn list
On Thu, Nov 29, 2012 at 4:55 PM, Eric Wong <normalperson@yhbt.net> wrote:
> In my testing, only dropped clients over Unix domain sockets or
> loopback TCP were detected with this option. Since many
> nginx+unicorn combinations run on the same host, this is not a
> problem.
>
> Furthermore, tcp_nodelay:true appears to work over loopback,
> so remove the requirement for tcp_nodelay:false.
In production our configuration is same host / UNIX domain socket, so
I don't have any comment on the TCP changes.
It makes sense to me though, and the documentation looks better!
Cheers,
Tom
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying
^ permalink raw reply [relevance 7%]
* [RFC/PATCH] check_client_connection: document local-only requirement
@ 2012-11-29 21:55 5% ` Eric Wong
2012-11-29 23:47 7% ` Tom Burns
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2012-11-29 21:55 UTC (permalink / raw)
To: unicorn list
In my testing, only dropped clients over Unix domain sockets or
loopback TCP were detected with this option. Since many
nginx+unicorn combinations run on the same host, this is not a
problem.
Furthermore, tcp_nodelay:true appears to work over loopback,
so remove the requirement for tcp_nodelay:false.
---
Eric Wong <normalperson@yhbt.net> wrote:
> Tom Burns <tom.burns@jadedpixel.com> wrote:
> > + if set[:check_client_connection]
> > + set[:listeners].each do |address|
> > + if set[:listener_opts][address][:tcp_nopush] == true
> > + raise ArgumentError,
> > + "check_client_connection is incompatible with tcp_nopush:true"
> > + end
>
> Btw, were you using:
>
> 1) TCP over loopback (bound to 0.0.0.0, client comes from 127.0.0.1)
> 2) TCP over a LAN (separate client/server hosts)
> 3) Unix domain socket
>
> I wonder if we can drop the below hunk for checking :tcp_nodelay,
> and document that check_client_connection requires the client to
> either be from a Unix domain socket or TCP loopback to work.
>
> > + if set[:listener_opts][address][:tcp_nodelay] == true
> > + raise ArgumentError,
> > + "check_client_connection is incompatible with tcp_nodelay:true"
> > + end
>
> I couldn't get 2) to work with either value of tcp_nodelay. My small
> LAN at home only has ~0.100ms latency.
>
> Happily, with TCP over loopback (on Linux 3.6), either value of
> tcp_nodelay works, so the tcp_nodelay check seems unnecessary after
> all.
lib/unicorn/configurator.rb | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/lib/unicorn/configurator.rb b/lib/unicorn/configurator.rb
index 9752cdd..7651093 100644
--- a/lib/unicorn/configurator.rb
+++ b/lib/unicorn/configurator.rb
@@ -103,10 +103,6 @@ class Unicorn::Configurator
raise ArgumentError,
"check_client_connection is incompatible with tcp_nopush:true"
end
- if set[:listener_opts][address][:tcp_nodelay] == true
- raise ArgumentError,
- "check_client_connection is incompatible with tcp_nodelay:true"
- end
end
end
set.each do |key, value|
@@ -473,8 +469,11 @@ class Unicorn::Configurator
# This will prevent calling the application for clients who have
# disconnected while their connection was queued.
#
- # This option cannot be used in conjunction with tcp_nodelay or
- # tcp_nopush.
+ # This only affects clients connecting over Unix domain sockets
+ # and TCP via loopback (127.*.*.*). It is unlikely to detect
+ # disconnects if the client is on a remote host (even on a fast LAN).
+ #
+ # This option cannot be used in conjunction with :tcp_nopush.
def check_client_connection(bool)
set_bool(:check_client_connection, bool)
end
--
1.8.0.3.gdd57fab.dirty
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying
^ permalink raw reply related [relevance 5%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2012-10-30 20:40 Combating nginx 499 HTTP responses during flash traffic scenario Tom Burns
2012-10-30 21:37 ` Eric Wong
2012-11-02 17:59 ` Tom Burns
2012-11-02 19:38 ` Eric Wong
2012-11-03 22:45 ` Tom Burns
2012-11-05 11:48 ` Eric Wong
2012-11-06 3:16 ` Tom Burns
2012-11-06 21:23 ` Eric Wong
2012-11-29 15:52 ` Tom Burns
2012-11-29 21:19 ` Eric Wong
2012-11-29 21:55 5% ` [RFC/PATCH] check_client_connection: document local-only requirement Eric Wong
2012-11-29 23:47 7% ` Tom Burns
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).