Hi Trustin,<div><br></div><div>I&#39;ve not made the HttpCore/NIO vs Netty benchmark yet, but I&#39;m doing instead some more benchmarks, using &#39;ab&#39; this time. I also get quite often this error, again when the -C parameter is over 2500: </div>

<div><br></div><div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">&gt;&gt; ab -n10000 -c3000 &#39;<a href="http://69.164.208.81:8000/">http://69.164.208.81:8000/</a>&#39;</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">Completed 1000 requests</font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">Completed 2000 requests</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">Completed 3000 requests</font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">Completed 4000 requests</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace"><b>apr_socket_recv: Connection reset by peer (104)</b></font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">This is ApacheBench, Version 2.3 &lt;$Revision: 655654 $&gt;</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">Copyright 1996 Adam Twiss, Zeus Technology Ltd, <a href="http://www.zeustech.net/">http://www.zeustech.net/</a></font></div>

<div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">Licensed to The Apache Software Foundation, <a href="http://www.apache.org/">http://www.apache.org/</a></font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace"><br>

</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">Benchmarking 69.164.208.81 (be patient)</font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">Total of 4123 requests completed</font></div>

</div><div><br></div><div>and at some point when -C=6000), all connections are properly processed. So it&#39;s likely to be a sytem configuration problem, but then at some point the Netty server becomes unresponsive.</div>

<div><br></div><div>Would you have some tips on how to find the reason for the connection reset and also on how to detect (from the Netty server) that Netty becomes unresponsive ?</div><div><br></div><div>Thanks,</div><div>

<br></div><div> -- Sébastien<br><br><div class="gmail_quote">2010/1/6 &quot;Trustin Lee (이희승)&quot; <span dir="ltr">&lt;<a href="mailto:trustin@gmail.com">trustin@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hi Sébastien,<br>
<br>
You might be running out of available ports due to many TIME_WAIT either<br>
on the client or server side.  Could you confirm it?  If so, you need to<br>
wait until the TIME_WAIT state is cleared between each run.<br>
<br>
If HttpCore/NIO version works fine when Netty fails, I&#39;d like to compare<br>
the two to see what the differences are.  Please paste or attach the<br>
source code.<br>
<br>
Thanks,<br>
Trustin<br>
<div><div></div><div class="h5"><br>
Sébastien Pierre wrote:<br>
&gt; Hi there !<br>
&gt;<br>
&gt; I just moved a test HTTP service from HttpCore/NIO to Netty based on the<br>
&gt; HTTP snoop example. I experienced (despite good performance at first) that<br>
&gt; the server is dropping connections when the load is heavy. To reproduce<br>
&gt; this, simply start the snoop example:<br>
&gt;<br>
&gt; java -cp ./src/main/java/:./jar/netty-3.2.0.ALPHA2.jar<br>
&gt; org.jboss.netty.example.http.snoop.HttpServer<br>
&gt;<br>
&gt; and then do<br>
&gt;<br>
&gt; python -c&#39;for r in range(500,10500,500): import os ; os.system(&quot;httperf<br>
&gt; --hog --timeout=60 --client=0/1 --server=127.0.0.1 --port=8080 --uri=/<br>
&gt; --rate=%s --send-buffer=4096 --recv-buffer=16384 --num-conns=10000<br>
&gt; --num-calls=1&quot; % (r))&#39;<br>
&gt;<br>
&gt; which is the same as running this command with --rate growing from 500 to<br>
&gt; 10000 with 500 increases.<br>
&gt;<br>
&gt; httperf --hog --timeout=60 --client=0/1 --server=127.0.0.1 --port=8080<br>
&gt; --uri=/ --rate=500 --send-buffer=4096 --recv-buffer=16384 --num-conns=10000<br>
&gt; --num-calls=1<br>
&gt;<br>
&gt; so in this example, Netty often drops connections between rates of 3000 and<br>
&gt; 5000, which you&#39;ll see in httpperf&#39;s log with the following lines:<br>
&gt;<br>
&gt; httperf: connection failed with unexpected error 98<br>
&gt; ...<br>
&gt; Errors: total 2236 client-timo 0 socket-timo 0 connrefused 0 connreset 0<br>
&gt; Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 2236<br>
&gt;<br>
&gt; I attached a graph where you&#39;ll see that for the rate=4000 and rate=45000<br>
&gt; the server just dropped all the connections (from httperf&#39;s perspective at<br>
&gt; least). So do you know any way to prevent or at least detect that ?<br>
&gt;<br>
&gt; Thanks !<br>
&gt;<br>
&gt;  -- Sébastien<br>
&gt;<br>
&gt; PS: I should add that I&#39;ve run the test a couple of times, and quite often<br>
&gt; have trouble in the rate=3000-5000 range<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; ------------------------------------------------------------------------<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; netty-users mailing list<br>
&gt; <a href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/netty-users" target="_blank">https://lists.jboss.org/mailman/listinfo/netty-users</a><br>
<font color="#888888"><br>
--<br>
what we call human nature in actuality is human habit<br>
<a href="http://gleamynode.net/" target="_blank">http://gleamynode.net/</a><br>
<br>
<br>
</font><br>_______________________________________________<br>
netty-users mailing list<br>
<a href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/netty-users" target="_blank">https://lists.jboss.org/mailman/listinfo/netty-users</a><br>
<br></blockquote></div><br></div>