All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Stefan (metze) Metzmacher" <metze@samba.org>
To: Jeff Layton <jlayton@samba.org>
Cc: Steve French <sfrench@samba.org>,
	Dave Chiluk <chiluk@canonical.com>,
	samba-technical@lists.samba.org, linux-kernel@vger.kernel.org,
	linux-cifs@vger.kernel.org
Subject: Re: [PATCH] CIFS: Decrease reconnection delay when switching nics
Date: Thu, 28 Feb 2013 01:15:49 +0100	[thread overview]
Message-ID: <512EA1B5.5010801@samba.org> (raw)
In-Reply-To: <20130227083419.0af9deaf@corrin.poochiereds.net>

[-- Attachment #1: Type: text/plain, Size: 2335 bytes --]

Am 27.02.2013 17:34, schrieb Jeff Layton:
> On Wed, 27 Feb 2013 12:06:14 +0100
> "Stefan (metze) Metzmacher" <metze@samba.org> wrote:
> 
>> Hi Dave,
>>
>>> When messages are currently in queue awaiting a response, decrease amount of
>>> time before attempting cifs_reconnect to SMB_MAX_RTT = 10 seconds. The current
>>> wait time before attempting to reconnect is currently 2*SMB_ECHO_INTERVAL(120
>>> seconds) since the last response was recieved.  This does not take into account
>>> the fact that messages waiting for a response should be serviced within a
>>> reasonable round trip time.
>>
>> Wouldn't that mean that the client will disconnect a good connection,
>> if the server doesn't response within 10 seconds?
>> Reads and Writes can take longer than 10 seconds...
>>
> 
> Where does this magic value of 10s come from? Note that a slow server
> can take *minutes* to respond to writes that are long past the EOF.
> 
>>> This fixes the issue where user moves from wired to wireless or vice versa
>>> causing the mount to hang for 120 seconds, when it could reconnect considerably
>>> faster.  After this fix it will take SMB_MAX_RTT (10 seconds) from the last
>>> time the user attempted to access the volume or SMB_MAX_RTT after the last
>>> echo.  The worst case of the latter scenario being
>>> 2*SMB_ECHO_INTERVAL+SMB_MAX_RTT+small scheduling delay (about 130 seconds).
>>> Statistically speaking it would normally reconnect sooner.  However in the best
>>> case where the user changes nics, and immediately tries to access the cifs
>>> share it will take SMB_MAX_RTT=10 seconds.
>>
>> I think it would be better to detect the broken connection
>> by using an AF_NETLINK socket listening for RTM_DELADDR
>> messages?
>>
>> metze
>>
> 
> Ick -- that sounds horrid ;)

This is what winbindd uses to detect that a source ip of outgoing
connections
are gone. I don't know much of the kernel, there might be a better way
from within
the kernel to detect this. But this is exactly the correct thing to
do to failover to another interface, as it just happens when the ip is
removed
without messing with a timeout value.

Another optimization would be to use tcp keepalives (I think there 10
seconds would be ok),
I think that's what Windows SMB3 clients are using.

metze


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 261 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: "Stefan (metze) Metzmacher" <metze@samba.org>
To: Jeff Layton <jlayton@samba.org>
Cc: Dave Chiluk <chiluk@canonical.com>,
	Steve French <sfrench@samba.org>,
	linux-cifs@vger.kernel.org, samba-technical@lists.samba.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] CIFS: Decrease reconnection delay when switching nics
Date: Thu, 28 Feb 2013 01:15:49 +0100	[thread overview]
Message-ID: <512EA1B5.5010801@samba.org> (raw)
In-Reply-To: <20130227083419.0af9deaf@corrin.poochiereds.net>

[-- Attachment #1: Type: text/plain, Size: 2335 bytes --]

Am 27.02.2013 17:34, schrieb Jeff Layton:
> On Wed, 27 Feb 2013 12:06:14 +0100
> "Stefan (metze) Metzmacher" <metze@samba.org> wrote:
> 
>> Hi Dave,
>>
>>> When messages are currently in queue awaiting a response, decrease amount of
>>> time before attempting cifs_reconnect to SMB_MAX_RTT = 10 seconds. The current
>>> wait time before attempting to reconnect is currently 2*SMB_ECHO_INTERVAL(120
>>> seconds) since the last response was recieved.  This does not take into account
>>> the fact that messages waiting for a response should be serviced within a
>>> reasonable round trip time.
>>
>> Wouldn't that mean that the client will disconnect a good connection,
>> if the server doesn't response within 10 seconds?
>> Reads and Writes can take longer than 10 seconds...
>>
> 
> Where does this magic value of 10s come from? Note that a slow server
> can take *minutes* to respond to writes that are long past the EOF.
> 
>>> This fixes the issue where user moves from wired to wireless or vice versa
>>> causing the mount to hang for 120 seconds, when it could reconnect considerably
>>> faster.  After this fix it will take SMB_MAX_RTT (10 seconds) from the last
>>> time the user attempted to access the volume or SMB_MAX_RTT after the last
>>> echo.  The worst case of the latter scenario being
>>> 2*SMB_ECHO_INTERVAL+SMB_MAX_RTT+small scheduling delay (about 130 seconds).
>>> Statistically speaking it would normally reconnect sooner.  However in the best
>>> case where the user changes nics, and immediately tries to access the cifs
>>> share it will take SMB_MAX_RTT=10 seconds.
>>
>> I think it would be better to detect the broken connection
>> by using an AF_NETLINK socket listening for RTM_DELADDR
>> messages?
>>
>> metze
>>
> 
> Ick -- that sounds horrid ;)

This is what winbindd uses to detect that a source ip of outgoing
connections
are gone. I don't know much of the kernel, there might be a better way
from within
the kernel to detect this. But this is exactly the correct thing to
do to failover to another interface, as it just happens when the ip is
removed
without messing with a timeout value.

Another optimization would be to use tcp keepalives (I think there 10
seconds would be ok),
I think that's what Windows SMB3 clients are using.

metze


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 261 bytes --]

  parent reply	other threads:[~2013-02-28  0:15 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-25 22:28 [PATCH] CIFS: Decrease reconnection delay when switching nics Dave Chiluk
2013-02-27 11:06 ` Stefan (metze) Metzmacher
2013-02-27 16:34   ` Jeff Layton
2013-02-27 16:34     ` Jeff Layton
     [not found]     ` <20130227083419.0af9deaf-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2013-02-27 22:24       ` Dave Chiluk
2013-02-27 22:24         ` Dave Chiluk
     [not found]         ` <512E8787.6070709-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
2013-02-27 22:40           ` Steve French
2013-02-27 22:40             ` Steve French
2013-02-27 22:44             ` Dave Chiluk
2013-02-28  0:17               ` Stefan (metze) Metzmacher
2013-02-28  0:17                 ` Stefan (metze) Metzmacher
2013-02-28  1:25               ` simo
2013-02-28  1:25                 ` simo
     [not found]               ` <512E8C31.8070106-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
2013-02-28  1:26                 ` Tom Talpey
2013-02-28  1:26                   ` Tom Talpey
2013-02-28 15:26         ` Jeff Layton
2013-02-28 15:26           ` Jeff Layton
     [not found]           ` <20130228072637.3b71a4f7-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2013-02-28 16:04             ` Steve French
2013-02-28 16:04               ` Steve French
     [not found]               ` <CAH2r5mtBHO6woWeOJ+DJDBmF35VTfuFYo2iza--xAe7grnELAg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-28 16:47                 ` Jeff Layton
2013-02-28 16:47                   ` Jeff Layton
2013-02-28 17:31                   ` Dave Chiluk
2013-02-28 17:31                     ` Dave Chiluk
     [not found]                     ` <512F948A.9060404-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
2013-02-28 17:45                       ` Steve French
2013-02-28 17:45                         ` Steve French
2013-02-28 18:04                       ` Jeff Layton
2013-02-28 18:04                         ` Jeff Layton
2013-02-28 22:23                       ` simo
2013-02-28 22:23                         ` simo
2013-02-28 22:54           ` Björn JACKE
2013-02-28 22:54             ` Björn JACKE
     [not found]             ` <E1UBCMh-00FRaK-CC-dqLtpHMqGvUyWpdLl23E4A@public.gmane.org>
2013-03-01  0:11               ` Jeff Layton
2013-03-01  0:11                 ` Jeff Layton
     [not found]                 ` <20130228161151.0fbbff98-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2013-03-01  2:54                   ` Steve French
2013-03-01  2:54                     ` Steve French
2013-02-28  0:15     ` Stefan (metze) Metzmacher [this message]
2013-02-28  0:15       ` Stefan (metze) Metzmacher
2013-02-28 13:01       ` Tom Talpey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=512EA1B5.5010801@samba.org \
    --to=metze@samba.org \
    --cc=chiluk@canonical.com \
    --cc=jlayton@samba.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=samba-technical@lists.samba.org \
    --cc=sfrench@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.