title: Does haproxy buffer tcp request body when backend is down?
body: <p>I am using haproxy 1.6.4 as TCP(not HTTP) proxy.
  My clients are making TCP requests. They do not wait for any response, they just send the data and close the connection.</p>
  
  <p>How haproxy behaves when all back-end nodes are down?
  I see that (from the client point of view) haproxy is accepting incomming connections.</p>
  
  <p>Haproxy statistics show that front-end has status OPEN, he is accepting connections.</p>
  
  <p>Number of sessions and bytes-in increases for frontend, but not for back-end (he is DOWN).</p>
  
  <p>Is haproxy buffering incoming TCP requests, and will pass them to the back-end once back-end is up?
  If yes, it is possible to configure this buffer size? Where data is buffered (in memory, disk?)</p>
  
  <p>Is this possible to turn off front-end (do not accept incoming TCP connections) when all back-end nodes are DOWN?</p>
  
  <p>Edit:
  when backend started, I see that
   * backend in-bytes and sessions is equal to front-end number of sessions
   * but my one and only back-end node has fever number of bytes-in, fever sessions and has errors.</p>
  
  <p>So, it seems that in default configuration there is no tcp buffering.
  Data is accepted by haproxy even if all backend nodes are down, but this data is lost.
  I would prefer to turn off tcp front-end when there are no backend servers- so client connections would be rejected. Is that possible?</p>
  
  <p>edit:
  haproxy log is</p>
  
  <blockquote>
    <p>Jul 15 10:02:32 172.17.0.2 haproxy[1]: 185.130.180.3:11319
    [15/Jul/2016:10:02:32.335] tcp-in app/ -1/-1/0 0 SC \0/0/0/0/0
    0/0 908</p>
  </blockquote>
  
  <p>my log format is</p>
  
  <blockquote>
    <p>%ci:%cp\ [%t]\ %ft\ %b/%s\ %Tw/%Tc/%Tt\ %B\ %ts\ \%ac/%fc/%bc/%sc/%rc\ %sq/%bq\ %U</p>
  </blockquote>
  
  <p>What I understand from log:</p>
  
  <ul>
  <li>there are no backeend servers</li>
  <li><p>termination state SC translates to</p>
  
  <p>S : the TCP session was unexpectedly aborted by the server, or the
              server explicitly refused it.
  C : the proxy was waiting for the CONNECTION to establish on the
          server. The server might at most have noticed a connection attempt.</p></li>
  </ul>