Hi Patrick Hemmer.

Patrick Hemmer have written on Thu, 4 May 2017 19:41:59 -0400:

> I'm looking to get some clarification around the documentation for the
> duration of sticky counter tracking. There are 2 specific points I'm a
> little confused on.
> 
> 1. Under the documentation for `tcp-request content`, it says:
> > In case of HTTP keep-alive with the client, all tcp-request
> > content  
> rules are evaluated again, so haproxy keeps a record of what sticky
> counters were assigned by a "tcp-request connection" versus a
> "tcp-request content" rule, and flushes all the content-related ones
> after processing an HTTP request
> 
> This sounds like if I were to use `tcp-request content track-sc0 src`,
> that after the http request is finished processing, the sticky counter
> for the source IP will be stop being tracked. However this does not
> appear to be the case as when I log sc0_conn_cur, it is counting
> clients that are sitting idle between http requests (using http
> keep-alive).
> 
> 2. Under the documentation for `http-request track-sc0`, it says:
> > Once a "track-sc*" rule is executed, the key is looked up in the
> > table  
> and if it is not found, an entry is allocated for it. Then a pointer
> to that entry is kept during all the session's life
> 
> This sounds like the sticky counter is tracked for the duration of the
> http session: "entry is kept during all the **session's** life".
> However this does not seem to be the case as when I log sc0_conn_cur,
> clients that are sitting idle between http requests are not counted.
> 
> 
> Am I interpreting the documentation incorrectly, or is the
> documentation incorrect?

Buh that's difficult to answer but maybe you can take a look into the
intro doc.

http://www.haproxy.org/download/1.7/doc/intro.txt

There is a section about Stick-tables

3.3.11. Basic features : Stick-tables

There is also a descritption in the source.
http://git.haproxy.org/?p=haproxy-1.7.git;a=blob;f=include/types/stick_table.h;hb=0f97bdec990a8f06742efcedf9fd419443300d63#l185

###
 185  * What's the purpose of there two macro:
 186  *   - STKCTR_TRACK_BACKEND indicates that a tracking pointer was set from 
the backend
 187  *    and thus that when a keep-alive request goes to another backend, the 
track
 188  *    must cease.
 189  *
 190  *   - STKCTR_TRACK_CONTENT indicates that the tracking pointer was set in 
a
 191  *    content-aware rule (tcp-request content or http-request) and that the
 192  *    tracking has to be performed in the stream and not in the session, 
and
 193  *    will cease for a new keep-alive request over the same
 connection.
###

Does this information helps you to understand the behavior?

> -Patrick

Regards
Aleks

Reply via email to