title: Packets dropped by kernel during load testing of haproxy -> node.js -> db
body: <p>we are in the process of load testing our game server stack, which consists of haproxy/ssl -> node.js (app servers) -> database</p>
  
  <p>The calls are gets which then node.js passes to the db then returns data back to the client, how ever during various testing we are seeing various odd issues that we cant seem to track down.</p>
  
  <p>While running tcpdump 'tcp[13] &amp; 4!=0' | grep http-alt</p>
  
  <p>We see various things in the log:</p>
  
  <p><code>
  23:35:16.049886 IP xx > xx.http-alt: Flags [R], seq 2946709660, win 0, length 0
  23:35:16.668370 IP xx.62737 > xx.http-alt: Flags [R.], seq 4204676699, ack 3037703652, win 68, options [nop,nop,TS val 153103530 ecr 133109021], length 0
  23:36:06.030500 IP xx.40290 > xx.http-alt: Flags [R.], seq 431162404, ack 2610577956, win 68, options [nop,nop,TS val 153115871 ecr 133121361], length 0
  </code></p>
  
  <p>Exiting the command we see </p>
  
  <p>1662286 packets received by filter
  9 packets dropped by kernel</p>
  
  <p>our load testing apps also returns errors back to us.. along the lines of this</p>
  
  <p><code>
      T000023 --- loop started --- 19 Aug 2013 18:09:07.975 ---r"
      T000023r"
      T000023 &lt;&lt;&lt; user_id = nullr"
      T000023 &lt;&lt;&lt; ext_userid = nullr"
      T000023 &lt;&lt;&lt; Public_token_put = nullr"
      T000023 &lt;&lt;&lt; Private_token_prt = nullr"
      T000023 >>> execute plug-in #1: GenerateRandomCharactersr"
      T000023r"
      T000023r"
      T000023 # Page #1: Registrationr"
      T000023 # ---------------------r"
      T000023r"
      T000023 [1] GET <a href="https://someurl.com:2222/?method=somemethod&amp;type=reg=somerandomid" rel="nofollow">https://someurl.com:2222/?method=somemethod&amp;type=reg=somerandomid</a> ...r"
      T000023 -8 (Network Connection aborted by Server), [No Content Type], --- bytes, --- ms, <strong>* Failed at 'Open Network Connection', java.net.SocketException: Connection resetr"
      T000023 <em></strong> error: expected HTTP status: 200 &lt;> received: -8 (Network Connection aborted by Server), [No Content Type], --- bytes, --- ms, *</em>* Failed at 'Open Network Connection', java.net.SocketException: Connection resetr
  </code></p>
  
  <p>Any thoughts on where to start.. </p>
  
  <p>servers are ubuntu 12.04 server with one tweak to sysctl</p>
  
  <p>net.netfilter.nf_conntrack_max = 262144</p>