From dev-return-5425-apmail-activemq-dev-archive=activemq.apache.org@activemq.apache.org Thu Feb 22 02:49:26 2007 Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 6978 invoked from network); 22 Feb 2007 02:49:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Feb 2007 02:49:25 -0000 Received: (qmail 75789 invoked by uid 500); 22 Feb 2007 02:49:33 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 75754 invoked by uid 500); 22 Feb 2007 02:49:33 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 75745 invoked by uid 99); 22 Feb 2007 02:49:33 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Feb 2007 18:49:33 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Feb 2007 18:49:24 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id F1DFC7141B8 for ; Wed, 21 Feb 2007 18:49:03 -0800 (PST) Message-ID: <25102138.1172112543987.JavaMail.jira@brutus> Date: Wed, 21 Feb 2007 18:49:03 -0800 (PST) From: =?ISO-8859-1?Q?David_Mart=EDn_Clavo_=28JIRA=29?= To: dev@activemq.apache.org Subject: [jira] Commented: (AMQ-1156) option "wireFormat.tcpNoDelayEnabled=true" is ignored In-Reply-To: <25337530.1170836283907.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/AMQ-1156?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel#action_38560 ]=20 David Mart=EDn Clavo commented on AMQ-1156: ----------------------------------------- Some more findings... It seems that even the socket.tcpNoDelay option does nothing to set TCP_NOD= ELAY on broker sockets, when written in the activemq.xml file, like for exa= mple: =20 =20 None of the options I put has any effect on the broker's sockets, but they = all are accepted by the options parser without throwing an exception. In some scenarios some delayed ACK timeouts were still appearing because of= the broker's sockets having TCP_NODELAY =3D false even if the client socke= ts have TCP_NODELAY =3D true. So, if you really want to disable Nagle's Algorithm in ActiveMQ without exc= eption (broker and clients), one should go to the org.apache.activemq.trans= port.tcp.TcpTransport.initialiseSocket method and add the following line at= the end of the method: sock.setTcpNoDelay(true); > option "wireFormat.tcpNoDelayEnabled=3Dtrue" is ignored > ----------------------------------------------------- > > Key: AMQ-1156 > URL: https://issues.apache.org/activemq/browse/AMQ-1156 > Project: ActiveMQ > Issue Type: Bug > Components: Documentation, Test Cases, Transport > Affects Versions: 4.0, 4.1.0, 4.2.0 > Environment: Any. > Reporter: David Mart=EDn Clavo > > *A. Description* > Setting the wireFormat.tcpNoDelayEnabled flag to true in connection uri's= (for example _"tcp://localhost:61616?wireFormat.tcpNoDelayEnabled"_) has n= o effect: > The sockets created in ActiveMQ do not have the TcpNoDelay flag set to tr= ue. > You can verify this for example in the following way: insert the line _Sy= stem.err.println(sock.getTcpNoDelay());_ at the end of the method > _org.apache.activemq.transport.tcp.TcpTransport.initialiseSocket_. > Also you can try my test at http://www.nabble.com/High-latency-for-small-= messages-problem-t3159901.html which makes latency appear if Nagle's algori= thm is not disabled. > This affects versions 4.0, 4.1.0, and 4.2.0 latest snapshot. I guess 4.0.= 2 is affected too. > *B. Reason* > After looking at the source code to understand how the options are set, i= saw that in the method org.apache.activemq.transport.tcp.TcpTransportFacto= ry.compositeConfigure the following line appears: > _Map socketOptions =3D IntrospectionSupport.extractProperties(options, "s= ocket.")_;=20 > and also that the method to set the TcpNoDelay option in class _org.apach= e.activemq.transport.tcp.TcpTransport_ is called _setTcpNoDelay_ and not _s= etTcpNoDelayEnabled_ > Therefore, I tried to write _"socket.tcpNoDelay=3Dtrue"_ instead of _"wir= eFormat.tcpNoDelayEnabled=3Dtrue"_ and it *worked!* This is a *workaround*. > But, _"wireFormat.tcpNoDelayEnabled"_ option is not refused (as _"wireFor= mat.tcpNoDelayTypoEnabled"_ would be). The option _"tcpNoDelay=3Dtrue"_ is = not refused either, but DOES NOT work either. > *C. Fix* > So, please, for the sake of the poor soul who's next going to try to disa= ble Nagle's algorithm without noticing any effect, and will start looking f= or the problem elsewhere (and for the sake of consistency also): > -Either change the documentation (http://www.activemq.org/site/tcp-transp= ort-reference.html and http://www.activemq.org/site/configuring-wire-format= s.html) to say that one should use the _socket.tcpNoDelay_ option, or > -Change the code to obey the documentation (and make it refuse old option= s like just _"tcpNoDelay"_ who have no effect). > Personally I would change the documentation ASAP so that people know abou= t the _"socket.tcpNoDelay=3Dtrue"_ workaround until next version, and then = change the code to recognize the _"wireFormat.tcpNoDelayTypoEnabled"_ optio= n. I'd like to point out that the own ActiveMQ test cases use _"wireFormat.= tcpNoDelayTypoEnabled"_ . > *D. Related issues* > This is related to a previous post of mine: http://www.nabble.com/High-la= tency-for-small-messages-problem-t3159901.html > Doing quick synchronized sends showed a 39ms latency if the broker is run= ning in Linux, and a 200ms latency if the broker is in Windows (by the way,= if someone knows the bottom reason for this exact latency times, please te= ll me). Putting the _"wireFormat.tcpNoDelayTypoEnabled"_ to true in order t= o disable Nagle's algorithm had no effect (because ActiveMQ does not recogn= ize it). > Very probably this is also related to issues https://issues.apache.org/ac= tivemq/browse/AMQ-1143 and https://issues.apache.org/activemq/browse/AMQ-11= 37 (in this one probably Helmutt tried to set the wireFormat.tcpNoDelayTypo= Enabled without success because of this). --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.