You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/10/18 18:12:54 UTC

svn commit: r1533530 - /subversion/trunk/subversion/libsvn_ra_svn/marshal.c

Author: stefan2
Date: Fri Oct 18 16:12:54 2013
New Revision: 1533530

URL: http://svn.apache.org/r1533530
Log:
Fix a major latency snafu in svnserve.  Sequences of small requests
and responses would be delayed in the TCP/IP stack by Nagle's alogrithm.
That becomes obvious when e.g. running "ls -R".

* subversion/libsvn_ra_svn/marshal.c
  (svn_ra_svn_create_conn3): send data as soon as write copy it from
                             our send buffers to the socket

Modified:
    subversion/trunk/subversion/libsvn_ra_svn/marshal.c

Modified: subversion/trunk/subversion/libsvn_ra_svn/marshal.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_svn/marshal.c?rev=1533530&r1=1533529&r2=1533530&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_svn/marshal.c (original)
+++ subversion/trunk/subversion/libsvn_ra_svn/marshal.c Fri Oct 18 16:12:54 2013
@@ -119,6 +119,16 @@ svn_ra_svn_conn_t *svn_ra_svn_create_con
             && apr_sockaddr_ip_get(&conn->remote_ip, sa) == APR_SUCCESS))
         conn->remote_ip = NULL;
       svn_ra_svn__stream_timeout(conn->stream, get_timeout(conn));
+
+      /* We are using large r/w buffers already.
+       * So, once we decide to actually send data, we want it to go over
+       * the wire a.s.a.p..  So disable Nagle's algorithm.
+       *
+       * We ignore the result of this call since it safe to continue even
+       * if we keep delaying.  The only negative effect is increased
+       * latency (can be additional 5 .. 10ms depending on circumstances).
+       */
+      apr_socket_opt_set(sock, APR_TCP_NODELAY, 1);
     }
   else
     {



Re: svn commit: r1533530 - /subversion/trunk/subversion/libsvn_ra_svn/marshal.c

Posted by Stefan Fuhrmann <st...@wandisco.com>.
On Mon, Oct 21, 2013 at 9:55 PM, Ivan Zhakov <iv...@visualsvn.com> wrote:

>
> On Friday, 18 October 2013, wrote:
>
>> Author: stefan2
>> Date: Fri Oct 18 16:12:54 2013
>> New Revision: 1533530
>>
>> URL: http://svn.apache.org/r1533530
>> Log:
>> Fix a major latency snafu in svnserve.  Sequences of small requests
>> and responses would be delayed in the TCP/IP stack by Nagle's alogrithm.
>> That becomes obvious when e.g. running "ls -R".
>>
>> Backport to 1.8.x?
>

After some deliberation, I think this would help merge performance
as well. So, we should backport it.

-- Stefan^2.

Re: svn commit: r1533530 - /subversion/trunk/subversion/libsvn_ra_svn/marshal.c

Posted by Ivan Zhakov <iv...@visualsvn.com>.
On Friday, 18 October 2013, wrote:

> Author: stefan2
> Date: Fri Oct 18 16:12:54 2013
> New Revision: 1533530
>
> URL: http://svn.apache.org/r1533530
> Log:
> Fix a major latency snafu in svnserve.  Sequences of small requests
> and responses would be delayed in the TCP/IP stack by Nagle's alogrithm.
> That becomes obvious when e.g. running "ls -R".
>
> Backport to 1.8.x?


-- 
Ivan Zhakov
CTO | VisualSVN | http://www.visualsvn.com