*From: *Willy Tarreau <[email protected]> *Sent: * 2014-01-25 04:43:28 E *To: *Patrick Hemmer <[email protected]> *CC: *[email protected] <[email protected]> *Subject: *Re: haproxy duplicate http_request_counter values
> Hi Patrick, > > On Sat, Jan 25, 2014 at 03:40:38AM -0500, Patrick Hemmer wrote: >> This patch does appear to have solved the issue reported, but it >> introduced another. >> If I use `http-request add-header` with %rt in the value to add the >> request ID, and then I also use it in `unique-id-format`, the 2 settings >> get different values. the value used for`http-request add-header` will >> be one less than the value used for `unique-id-format` (this applies to >> both using %ID in the log format and using `unique-id-header`). > You're damn right! I forgot this case where the ID could be used twice :-( > > So we have no other choice but copying the ID into the session or HTTP > transaction, since it's possible to use it several times. At the same > time, I'm wondering if we should not also increment it for new sessions, > because for people who forward non-HTTP traffic, there's no unique counter. > > What I'm thinking about is the following then : > > - increment the global counter on each new session and store it into > the session. > - increment it again when dealing with a new request over an existing > session. > > That way it would count each transaction, either TCP connection or HTTP > request. And since the ID would be assigned to the session, it would > remain stable for all the period where it's needed. > > What do you think ? Sounds reasonable. Running through it in my head, I can't conjure up any scenario where that approach wouldn't work. -Patrick

