You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by William Bell <bi...@gmail.com> on 2013/09/30 03:22:53 UTC

Nagle's Algorithm

How do I set TCP_NODELAY on the http sockets for Jetty in SOLR 4?

Is there an option in jetty.xml ?

/* Create new stream socket */

sock = *socket*( AF_INET, SOCK_STREAM, 0 );



/* Disable the Nagle (TCP No Delay) algorithm */

flag = 1;

ret = *setsockopt*( sock, IPPROTO_TCP, TCP_NODELAY, (char *)&flag,
sizeof(flag) );




-- 
Bill Bell
billnbell@gmail.com
cell 720-256-8076

Re: Nagle's Algorithm

Posted by Dan Davis <da...@gmail.com>.
I don't keep up with this list well enough to know whether anyone else
answered.  I don't know how to do it in jetty.xml, but you can certainly
tweak the code.   java.net.Socket has a method setTcpNoDelay() that
corresponds with the standard Unix system calls.

Long-time past, my suggestion of this made Apache Axis 2.0 250ms faster per
call (1).   Now I want to know whether Apache Solr sets it.

One common way to test the overhead portion of latency is to project the
latency for a zero size request based on larger requests.   What you do is
to "warm" requests (all in memory) for progressively fewer and fewer
rows.   You can make requests for 100, 90, 80, 70 ... 10 rows each more
than once so that all is warmed.   If you plot this, it should look like a
linear function latency(rows) = m(rows) + b since all is cached in
memory.   You have to control what else is going on on the server to get
the linear plot of course - it can be quite hard to get this to work right
on modern Linux.   But once you have it, you can simply calculate f(0) and
you have the latency for a theoretical 0 sized request.

This is a tangential answer at best - I wish I just knew a setting to give
you.

(1) Latency Performance of SOAP
Implementations<http://citeseer.ist.psu.edu/viewdoc/similar?doi=10.1.1.21.8556&type=ab>


On Sun, Sep 29, 2013 at 9:22 PM, William Bell <bi...@gmail.com> wrote:

> How do I set TCP_NODELAY on the http sockets for Jetty in SOLR 4?
>
> Is there an option in jetty.xml ?
>
> /* Create new stream socket */
>
> sock = *socket*( AF_INET, SOCK_STREAM, 0 );
>
>
>
> /* Disable the Nagle (TCP No Delay) algorithm */
>
> flag = 1;
>
> ret = *setsockopt*( sock, IPPROTO_TCP, TCP_NODELAY, (char *)&flag,
> sizeof(flag) );
>
>
>
>
> --
> Bill Bell
> billnbell@gmail.com
> cell 720-256-8076
>

Re: Nagle's Algorithm

Posted by Shawn Heisey <so...@elyograg.org>.
On 9/29/2013 7:22 PM, William Bell wrote:
> How do I set TCP_NODELAY on the http sockets for Jetty in SOLR 4?

The client usually makes that decision, not the server.  This parameter
is turned on by default for recent HttpClient versions, the library used
by SolrJ.  Even the JETTY issue uncovered by Michael Sokolov refers to a
client connection.

Thanks,
Shawn


Re: Nagle's Algorithm

Posted by Michael Sokolov <ms...@safaribooksonline.com>.
I dunno, but this makes it look as if this may already be taken care of:

http://jira.codehaus.org/browse/JETTY-1196

On 9/29/2013 9:22 PM, William Bell wrote:
> How do I set TCP_NODELAY on the http sockets for Jetty in SOLR 4?
>
> Is there an option in jetty.xml ?
>
> /* Create new stream socket */
>
> sock = *socket*( AF_INET, SOCK_STREAM, 0 );
>
>
>
> /* Disable the Nagle (TCP No Delay) algorithm */
>
> flag = 1;
>
> ret = *setsockopt*( sock, IPPROTO_TCP, TCP_NODELAY, (char *)&flag,
> sizeof(flag) );
>
>
>
>