subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1533530 - /subversion/trunk/subversion/libsvn_ra_svn/marshal.c
Date Fri, 18 Oct 2013 16:12:54 GMT
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
     {



Mime
View raw message