title: ACK & TCP Window on Ubuntu
body: <p>Good evening,</p>
  
  <p>I am working on a project which is using eventlet <a href="http://eventlet.net/" rel="nofollow">http://eventlet.net/</a> ontop of wsgi in Python to create a websocket server. So far everything is working well. We did some deep level packet analysis today however and noticed something odd. We are trying to minimize the outbound data from the server. At the moment it only seems to send ACK's which is taking up much of the data outbound at the moment (around 1M per hour).</p>
  
  <p>No matter what we set the receive window too on the Ubuntu sysctl file an ACK is being sent to the client at the same time (after 5 packets). We want to make this window larger such that maybe 1 ACK is sent every 15 packets these packets are 1440 Bytes in size </p>
  
  <p>Below are our sysctl settings for the TCP send and receive buffers</p>
  
  <pre><code>net.core.wmem_max = 4194304
  net.core.rmem_max = 6291456
  net.ipv4.tcp_rmem = 4096 2097152 6291456
  net.ipv4.tcp_wmem = 4096 1048576 4194304
  net.ipv4.tcp_window_scaling = 1
  net.ipv4.tcp_timestamps = 1
  net.ipv4.tcp_sack = 1
  net.core.netdev_max_backlog = 5000
  </code></pre>
  
  <p>As you will see we have scaling enabled, with it enabled the server is setting a Win=8159 in its Ack however even with it disabled and a default of 64k being sent in the servers ACK window the ACK is actually being sent back to the client around every 7k.</p>
  
  <p>Is there something fundamental we are missing here? Can a client set a buffer limit at which it will no longer send data unless it receive an ACK? Is there some sort of time limit at which a ACK is sent regardless of the received buffer size?</p>
  
  <p>Thank you for your help.</p>