Hi Erik, Do you have any process restarting/reloading haproxy from time to time? You seem to have enough entries in your table.
Maybe you can send me your configuration in a separated mail so I can have a look :) cheers On Thu, Dec 15, 2011 at 6:57 PM, Erik Torlen <[email protected]>wrote: > Hi Baptiste,**** > > ** ** > > It gives me this:**** > > ** ** > > root@domU-12-31-39-0B-49-C1:/home/haproxy# echo "show table" | socat > unix:/home/haproxy/status -**** > > # table: api, type: string, size:102400, used:11846**** > > ** ** > > /E**** > > ** ** > > *From:* Baptiste [mailto:[email protected]] > *Sent:* den 15 december 2011 12:33 > > *To:* Erik Torlen > *Cc:* [email protected] > *Subject:* Re: Appsession and persistance**** > > ** ** > > Hi Erik**** > > ** ** > > Can you paste your stick-table definition?**** > > You can get some information about your stick table using socat:**** > > echo "show table" | socat unix:/path/to/haproxy.stats -**** > > don't forget the last "-" which tells socat to print to stdout.**** > > ** ** > > a+**** > > ** ** > > On Thu, Dec 15, 2011 at 12:07 PM, Erik Torlen <[email protected]> > wrote:**** > > Hi Baptiste,**** > > **** > > I tried using stick-table and it worked better. But I still seeing > sessions being ended because of the request being directed to the wrong > backend server.**** > > **** > > When I don’t have any persistence enabled I get around 50% errors. But > using stick-tables give me around 15-20% errors. And the pattern of the > errors looks pretty weird. It is almost like the sessions are released in > some way after a certain time. (See the attached image which shows how the > errors are appearing in groups every 20-30s or so during a 5min loadtest.) > **** > > **** > > I tried increasing the len length and the size but the result was the same. > **** > > **** > > **** > > **** > > Any ideas?**** > > **** > > /E**** > > **** > > **** > > -----Original Message----- > From: Baptiste [mailto:[email protected]] > Sent: den 14 december 2011 17:25 > To: Erik Torlen > Cc: [email protected] > Subject: Re: Appsession and persistance**** > > **** > > Hi Erik,**** > > **** > > Forget about appsession, it's weak :)**** > > **** > > Use haproxy 1.5-dev7 and stick tables. In your backend, just add the**** > > few line below:**** > > stick-table type string len 32 size 10K**** > > stick store-response set-cookie(PHPSESSID)**** > > stick on url_param(session_id)**** > > **** > > I recommand using with "peer" keyword to get multiple haproxy to sync**** > > their tables.**** > > So in case of reload of haproxy or in case of lb failure, you could**** > > keep on redirecting users to the same backend.**** > > **** > > cheers**** > > **** > > **** > > **** > > On Wed, Dec 14, 2011 at 1:11 PM, Erik Torlen**** > > <[email protected]> wrote:**** > > > Hi,**** > > > **** > > > I am working with an application that does not use the cookie as a > "normal" application would do.**** > > > **** > > > Basically it receives PHPSESSID (currently two PHPSESSID is received, > which I would try to solve with their devs) and the returns the sessid as a > query string on every**** > > > call it makes against the web application.**** > > > **** > > > Example.**** > > > Step 1**** > > > **** > > > GET /login**** > > > ...**** > > > HTTP/1.1 200 OK**** > > > ...**** > > > Set-Cookie: PHPSESSID=m2b6m6rkp8l02lu5boflht2pq6; path=/**** > > > ...**** > > > **** > > > Step 2**** > > > **** > > > GET /list/?session_id= m2b6m6rkp8l02lu5boflht2pq6**** > > > ...**** > > > **** > > > HTTP/1.1 200 OK**** > > > ...**** > > > **** > > > **** > > > I tried using appsession for this like:**** > > > "appsession session_id len 27 timeout 1h request-learn mode query-string" > **** > > > **** > > > But that does not seem to work.**** > > > **** > > > I guess I need HAProxy to get the cookie value from the Set-Cookie > header and then keeping track of it using the query-string.**** > > > Is that possible to do? If so, how is it done?**** > > > **** > > > /E**** > > ** ** >
<<image001.png>>

