Re: stick-table and URL
Sorry for the problem.. but it was my problem.. its working now as expected.. again sorry for the troble.. -- Give a man a fish and you feed him for a day. Teach him how to fish and you feed him for a lifetime. On Wed, May 15, 2013 at 2:58 PM, Rui Luís rui.l...@gmail.com wrote: i was able to generate in the server the cookie (SERVERID) and i can pass it i also altered the line cookie SERVERID insert indirect nocache to cookie SERVERID and also try without the line however it is not working curl header: Set-Cookie: SERVERID=memtom1 is it possible to see the stick table content? -- Give a man a fish and you feed him for a day. Teach him how to fish and you feed him for a lifetime. On Mon, May 13, 2013 at 10:01 PM, Baptiste bed...@gmail.com wrote: Hi Rui, This is normal: HAProxy can't store in a stick table headers it has itself setup. So the line stick store-response set-cookie(SERVERID) table webservers_backend will work only if the server set-up the cookie. If you manage your server to setup this cookie, it may work with the configuration below: stick store-response set-cookie(SERVERID) table webservers_backend stick on cookie(SERVERID) table webservers_backend stick on url_param(SERVERID) table webservers_backend HAProxy will first try to collect stickiness information from the Cookie. If it can't find it, then it will look for the information in the url parameter. Baptiste On Mon, May 13, 2013 at 6:47 PM, Rui Luís rui.l...@gmail.com wrote: Good day. For a few days i am trying to use stick-table with cookies and url parameters because flash does not support cookies i have the following configuration: backend webservers_backend cookie SERVERID insert indirect nocache stick-table type string len 40 size 20k stick store-response set-cookie(SERVERID) table webservers_backend stick on url_param(SERVERID) table webservers_backend server memtom1 ip1 check inter 5000 cookie memtom1 server memtom2 ip2 check inter 5000 cookie memtom2 i also try other configurations.. however it does not work.. the call from flash.. getConfig?val1=xcv93ec9SERVERID=memtom2;%20path=/ i also try getConfig?val1=xcv93ec9SERVERID=memtom2 but it does not work for both.. I am entering a dead lock... -- Give a man a fish and you feed him for a day. Teach him how to fish and you feed him for a lifetime.
Re: stick-table and URL
i was able to generate in the server the cookie (SERVERID) and i can pass it i also altered the line cookie SERVERID insert indirect nocache to cookie SERVERID and also try without the line however it is not working curl header: Set-Cookie: SERVERID=memtom1 is it possible to see the stick table content? -- Give a man a fish and you feed him for a day. Teach him how to fish and you feed him for a lifetime. On Mon, May 13, 2013 at 10:01 PM, Baptiste bed...@gmail.com wrote: Hi Rui, This is normal: HAProxy can't store in a stick table headers it has itself setup. So the line stick store-response set-cookie(SERVERID) table webservers_backend will work only if the server set-up the cookie. If you manage your server to setup this cookie, it may work with the configuration below: stick store-response set-cookie(SERVERID) table webservers_backend stick on cookie(SERVERID) table webservers_backend stick on url_param(SERVERID) table webservers_backend HAProxy will first try to collect stickiness information from the Cookie. If it can't find it, then it will look for the information in the url parameter. Baptiste On Mon, May 13, 2013 at 6:47 PM, Rui Luís rui.l...@gmail.com wrote: Good day. For a few days i am trying to use stick-table with cookies and url parameters because flash does not support cookies i have the following configuration: backend webservers_backend cookie SERVERID insert indirect nocache stick-table type string len 40 size 20k stick store-response set-cookie(SERVERID) table webservers_backend stick on url_param(SERVERID) table webservers_backend server memtom1 ip1 check inter 5000 cookie memtom1 server memtom2 ip2 check inter 5000 cookie memtom2 i also try other configurations.. however it does not work.. the call from flash.. getConfig?val1=xcv93ec9SERVERID=memtom2;%20path=/ i also try getConfig?val1=xcv93ec9SERVERID=memtom2 but it does not work for both.. I am entering a dead lock... -- Give a man a fish and you feed him for a day. Teach him how to fish and you feed him for a lifetime.
Re: stick-table and URL
original message- De: Baptiste bed...@gmail.com A: Emeric BRUN eb...@exceliance.fr Copie à: haproxy@formilux.org Date: Tue, 14 May 2013 07:55:22 +0200 - Hi Emeric, I'm sure it works. We use the same trick for JSESSIONID cookie, and I can tell you it works. That's why I said to Rui to allow the server to setup the cookie. Sorry i miss that. But i'm sur cookie persistance match is prior on stick table rules, so if a cookie is cookie is match the stick-match rules are not eval and the expiration timestamp of the entry is not refreshed. That said, I'm almost sure your trick doesn't work. I'm pretty sure the cookie SERVERID has been removed by HAProxy when use-server rules are evaluated. The use-server does not match a cookie but an url parameter. So we don't care about cookie is present or not. Regards, Emeric Baptiste On Tue, May 14, 2013 at 7:47 AM, Emeric BRUN eb...@exceliance.fr wrote: Hi, I'am not sure the baptiste trick is usable. Please prefer use-server statement: cookie SERVERID insert indirect nocache use-server ip1 if { url_param(SERVERID) memtom1 } use-server ip2 if { url_param(SERVERID) memtom2 } server memtom1 ip1 check inter 5000 cookie memtom1 server memtom2 ip2 check inter 5000 cookie memtom2 Regards, Emeric original message- De: Baptiste bed...@gmail.com A: Rui Lu?s rui.l...@gmail.com Copie �: haproxy@formilux.org Date: Mon, 13 May 2013 23:01:08 +0200 - Hi Rui, This is normal: HAProxy can't store in a stick table headers it has itself setup. So the line stick store-response set-cookie(SERVERID) table webservers_backend will work only if the server set-up the cookie. If you manage your server to setup this cookie, it may work with the configuration below: stick store-response set-cookie(SERVERID) table webservers_backend stick on cookie(SERVERID) table webservers_backend stick on url_param(SERVERID) table webservers_backend HAProxy will first try to collect stickiness information from the Cookie. If it can't find it, then it will look for the information in the url parameter. Baptiste On Mon, May 13, 2013 at 6:47 PM, Rui Lu?s rui.l...@gmail.com wrote: Good day. For a few days i am trying to use stick-table with cookies and url parameters because flash does not support cookies i have the following configuration: backend webservers_backend cookie SERVERID insert indirect nocache stick-table type string len 40 size 20k stick store-response set-cookie(SERVERID) table webservers_backend stick on url_param(SERVERID) table webservers_backend server memtom1 ip1 check inter 5000 cookie memtom1 server memtom2 ip2 check inter 5000 cookie memtom2 i also try other configurations.. however it does not work.. the call from flash.. getConfig?val1=xcv93ec9SERVERID=memtom2;%20path=/ i also try getConfig?val1=xcv93ec9SERVERID=memtom2 but it does not work for both.. I am entering a dead lock... -- Give a man a fish and you feed him for a day. Teach him how to fish and you feed him for a lifetime.
Re: stick-table and URL
original message- De: Emeric BRUN eb...@exceliance.fr A: Baptiste bed...@gmail.com Copie à: haproxy@formilux.org Date: Tue, 14 May 2013 08:00:42 +0200 - original message- De: Baptiste bed...@gmail.com A: Emeric BRUN eb...@exceliance.fr Copie �: haproxy@formilux.org Date: Tue, 14 May 2013 07:55:22 +0200 - Hi Emeric, I'm sure it works. We use the same trick for JSESSIONID cookie, and I can tell you it works. That's why I said to Rui to allow the server to setup the cookie. This is not he same case, here we don't have a session id but a predictive serverid and it is a mess to use stick table. Sorry i miss that. But i'm sur cookie persistance match is prior on stick table rules, so if a cookie is cookie is match the stick-match rules are not eval and the expiration timestamp of the entry is not refreshed. That said, I'm almost sure your trick doesn't work. I'm pretty sure the cookie SERVERID has been removed by HAProxy when use-server rules are evaluated. The use-server does not match a cookie but an url parameter. So we don't care about cookie is present or not. Regards, Emeric Baptiste On Tue, May 14, 2013 at 7:47 AM, Emeric BRUN eb...@exceliance.fr wrote: Hi, I'am not sure the baptiste trick is usable. Please prefer use-server statement: cookie SERVERID insert indirect nocache use-server ip1 if { url_param(SERVERID) memtom1 } use-server ip2 if { url_param(SERVERID) memtom2 } server memtom1 ip1 check inter 5000 cookie memtom1 server memtom2 ip2 check inter 5000 cookie memtom2 Regards, Emeric original message- De: Baptiste bed...@gmail.com A: Rui Lu?s rui.l...@gmail.com Copie ?: haproxy@formilux.org Date: Mon, 13 May 2013 23:01:08 +0200 - Hi Rui, This is normal: HAProxy can't store in a stick table headers it has itself setup. So the line stick store-response set-cookie(SERVERID) table webservers_backend will work only if the server set-up the cookie. If you manage your server to setup this cookie, it may work with the configuration below: stick store-response set-cookie(SERVERID) table webservers_backend stick on cookie(SERVERID) table webservers_backend stick on url_param(SERVERID) table webservers_backend HAProxy will first try to collect stickiness information from the Cookie. If it can't find it, then it will look for the information in the url parameter. Baptiste On Mon, May 13, 2013 at 6:47 PM, Rui Lu?s rui.l...@gmail.com wrote: Good day. For a few days i am trying to use stick-table with cookies and url parameters because flash does not support cookies i have the following configuration: backend webservers_backend cookie SERVERID insert indirect nocache stick-table type string len 40 size 20k stick store-response set-cookie(SERVERID) table webservers_backend stick on url_param(SERVERID) table webservers_backend server memtom1 ip1 check inter 5000 cookie memtom1 server memtom2 ip2 check inter 5000 cookie memtom2 i also try other configurations.. however it does not work.. the call from flash.. getConfig?val1=xcv93ec9SERVERID=memtom2;%20path=/ i also try getConfig?val1=xcv93ec9SERVERID=memtom2 but it does not work for both.. I am entering a dead lock... -- Give a man a fish and you feed him for a day. Teach him how to fish and you feed him for a lifetime.
Re: stick-table and URL
On Tue, May 14, 2013 at 8:00 AM, Emeric BRUN eb...@exceliance.fr wrote: But i'm sur cookie persistance match is prior on stick table rules, so if a cookie is cookie is match the stick-match rules are not eval and the expiration timestamp of the entry is not refreshed. I also agree on this point. But where did I said to use cookie persistence? I just said configure your server to setup the cookie then use stick tables. Or maybe I misspell my thoughts. That said, I'm almost sure your trick doesn't work. I'm pretty sure the cookie SERVERID has been removed by HAProxy when use-server rules are evaluated. The use-server does not match a cookie but an url parameter. So we don't care about cookie is present or not. AHAHA, good catch :) Regards, Emeric Baptiste
stick-table and URL
Good day. For a few days i am trying to use stick-table with cookies and url parameters because flash does not support cookies i have the following configuration: backend webservers_backend cookie SERVERID insert indirect nocache stick-table type string len 40 size 20k stick store-response set-cookie(SERVERID) table webservers_backend stick on url_param(SERVERID) table webservers_backend server memtom1 ip1 check inter 5000 cookie memtom1 server memtom2 ip2 check inter 5000 cookie memtom2 i also try other configurations.. however it does not work.. the call from flash.. getConfig?val1=xcv93ec9SERVERID=memtom2;%20path=/ i also try getConfig?val1=xcv93ec9SERVERID=memtom2 but it does not work for both.. I am entering a dead lock... -- Give a man a fish and you feed him for a day. Teach him how to fish and you feed him for a lifetime.
Re: stick-table and URL
Hi Rui, This is normal: HAProxy can't store in a stick table headers it has itself setup. So the line stick store-response set-cookie(SERVERID) table webservers_backend will work only if the server set-up the cookie. If you manage your server to setup this cookie, it may work with the configuration below: stick store-response set-cookie(SERVERID) table webservers_backend stick on cookie(SERVERID) table webservers_backend stick on url_param(SERVERID) table webservers_backend HAProxy will first try to collect stickiness information from the Cookie. If it can't find it, then it will look for the information in the url parameter. Baptiste On Mon, May 13, 2013 at 6:47 PM, Rui Luís rui.l...@gmail.com wrote: Good day. For a few days i am trying to use stick-table with cookies and url parameters because flash does not support cookies i have the following configuration: backend webservers_backend cookie SERVERID insert indirect nocache stick-table type string len 40 size 20k stick store-response set-cookie(SERVERID) table webservers_backend stick on url_param(SERVERID) table webservers_backend server memtom1 ip1 check inter 5000 cookie memtom1 server memtom2 ip2 check inter 5000 cookie memtom2 i also try other configurations.. however it does not work.. the call from flash.. getConfig?val1=xcv93ec9SERVERID=memtom2;%20path=/ i also try getConfig?val1=xcv93ec9SERVERID=memtom2 but it does not work for both.. I am entering a dead lock... -- Give a man a fish and you feed him for a day. Teach him how to fish and you feed him for a lifetime.
Re: stick-table and URL
Hi, I'am not sure the baptiste trick is usable. Please prefer use-server statement: cookie SERVERID insert indirect nocache use-server ip1 if { url_param(SERVERID) memtom1 } use-server ip2 if { url_param(SERVERID) memtom2 } server memtom1 ip1 check inter 5000 cookie memtom1 server memtom2 ip2 check inter 5000 cookie memtom2 Regards, Emeric original message- De: Baptiste bed...@gmail.com A: Rui Lu�s rui.l...@gmail.com Copie à: haproxy@formilux.org Date: Mon, 13 May 2013 23:01:08 +0200 - Hi Rui, This is normal: HAProxy can't store in a stick table headers it has itself setup. So the line stick store-response set-cookie(SERVERID) table webservers_backend will work only if the server set-up the cookie. If you manage your server to setup this cookie, it may work with the configuration below: stick store-response set-cookie(SERVERID) table webservers_backend stick on cookie(SERVERID) table webservers_backend stick on url_param(SERVERID) table webservers_backend HAProxy will first try to collect stickiness information from the Cookie. If it can't find it, then it will look for the information in the url parameter. Baptiste On Mon, May 13, 2013 at 6:47 PM, Rui Lu�s rui.l...@gmail.com wrote: Good day. For a few days i am trying to use stick-table with cookies and url parameters because flash does not support cookies i have the following configuration: backend webservers_backend cookie SERVERID insert indirect nocache stick-table type string len 40 size 20k stick store-response set-cookie(SERVERID) table webservers_backend stick on url_param(SERVERID) table webservers_backend server memtom1 ip1 check inter 5000 cookie memtom1 server memtom2 ip2 check inter 5000 cookie memtom2 i also try other configurations.. however it does not work.. the call from flash.. getConfig?val1=xcv93ec9SERVERID=memtom2;%20path=/ i also try getConfig?val1=xcv93ec9SERVERID=memtom2 but it does not work for both.. I am entering a dead lock... -- Give a man a fish and you feed him for a day. Teach him how to fish and you feed him for a lifetime.
Re: stick-table and URL
I was wrong on use-server lines Correct ones: use-server memtom1 if { url_param(SERVERID) memtom1 } use-server memtom2 if { url_param(SERVERID) memtom2 } original message- De: Emeric BRUN eb...@exceliance.fr A: Baptiste bed...@gmail.com Copie à: haproxy@formilux.org Date: Tue, 14 May 2013 07:47:24 +0200 - Hi, I'am not sure the baptiste trick is usable. Please prefer use-server statement: cookie SERVERID insert indirect nocache use-server ip1 if { url_param(SERVERID) memtom1 } use-server ip2 if { url_param(SERVERID) memtom2 } server memtom1 ip1 check inter 5000 cookie memtom1 server memtom2 ip2 check inter 5000 cookie memtom2 Regards, Emeric original message- De: Baptiste bed...@gmail.com A: Rui Lu?s rui.l...@gmail.com Copie �: haproxy@formilux.org Date: Mon, 13 May 2013 23:01:08 +0200 - Hi Rui, This is normal: HAProxy can't store in a stick table headers it has itself setup. So the line stick store-response set-cookie(SERVERID) table webservers_backend will work only if the server set-up the cookie. If you manage your server to setup this cookie, it may work with the configuration below: stick store-response set-cookie(SERVERID) table webservers_backend stick on cookie(SERVERID) table webservers_backend stick on url_param(SERVERID) table webservers_backend HAProxy will first try to collect stickiness information from the Cookie. If it can't find it, then it will look for the information in the url parameter. Baptiste On Mon, May 13, 2013 at 6:47 PM, Rui Lu?s rui.l...@gmail.com wrote: Good day. For a few days i am trying to use stick-table with cookies and url parameters because flash does not support cookies i have the following configuration: backend webservers_backend cookie SERVERID insert indirect nocache stick-table type string len 40 size 20k stick store-response set-cookie(SERVERID) table webservers_backend stick on url_param(SERVERID) table webservers_backend server memtom1 ip1 check inter 5000 cookie memtom1 server memtom2 ip2 check inter 5000 cookie memtom2 i also try other configurations.. however it does not work.. the call from flash.. getConfig?val1=xcv93ec9SERVERID=memtom2;%20path=/ i also try getConfig?val1=xcv93ec9SERVERID=memtom2 but it does not work for both.. I am entering a dead lock... -- Give a man a fish and you feed him for a day. Teach him how to fish and you feed him for a lifetime.
Re: stick-table and URL
Hi Emeric, I'm sure it works. We use the same trick for JSESSIONID cookie, and I can tell you it works. That's why I said to Rui to allow the server to setup the cookie. That said, I'm almost sure your trick doesn't work. I'm pretty sure the cookie SERVERID has been removed by HAProxy when use-server rules are evaluated. Baptiste On Tue, May 14, 2013 at 7:47 AM, Emeric BRUN eb...@exceliance.fr wrote: Hi, I'am not sure the baptiste trick is usable. Please prefer use-server statement: cookie SERVERID insert indirect nocache use-server ip1 if { url_param(SERVERID) memtom1 } use-server ip2 if { url_param(SERVERID) memtom2 } server memtom1 ip1 check inter 5000 cookie memtom1 server memtom2 ip2 check inter 5000 cookie memtom2 Regards, Emeric original message- De: Baptiste bed...@gmail.com A: Rui Lu�s rui.l...@gmail.com Copie à: haproxy@formilux.org Date: Mon, 13 May 2013 23:01:08 +0200 - Hi Rui, This is normal: HAProxy can't store in a stick table headers it has itself setup. So the line stick store-response set-cookie(SERVERID) table webservers_backend will work only if the server set-up the cookie. If you manage your server to setup this cookie, it may work with the configuration below: stick store-response set-cookie(SERVERID) table webservers_backend stick on cookie(SERVERID) table webservers_backend stick on url_param(SERVERID) table webservers_backend HAProxy will first try to collect stickiness information from the Cookie. If it can't find it, then it will look for the information in the url parameter. Baptiste On Mon, May 13, 2013 at 6:47 PM, Rui Lu�s rui.l...@gmail.com wrote: Good day. For a few days i am trying to use stick-table with cookies and url parameters because flash does not support cookies i have the following configuration: backend webservers_backend cookie SERVERID insert indirect nocache stick-table type string len 40 size 20k stick store-response set-cookie(SERVERID) table webservers_backend stick on url_param(SERVERID) table webservers_backend server memtom1 ip1 check inter 5000 cookie memtom1 server memtom2 ip2 check inter 5000 cookie memtom2 i also try other configurations.. however it does not work.. the call from flash.. getConfig?val1=xcv93ec9SERVERID=memtom2;%20path=/ i also try getConfig?val1=xcv93ec9SERVERID=memtom2 but it does not work for both.. I am entering a dead lock... -- Give a man a fish and you feed him for a day. Teach him how to fish and you feed him for a lifetime.
Re: Multiple Load Balancers, stick table and url-embedded session support
Please see the thread: need help figuring out a sticking method I asked about this, Willie says there are issues figuring out a workable config syntax for 'regex to pull the URL/URI substring' but (I think) that coding the functionality is not technically super-difficult just not enough hands maybe and the config syntax? I have a feeling this would be a fairly commonly used feature, so it is good to see others asking the same question :) How are you planning to distribute the traffic to the different haproxy instances? LVS? Some hardware? On 12/8/10 8:58 PM, David wrote: Hi there, I have been asked to design an architecture for our load-balancing needs, and it looks like haproxy can do almost everything needed in a fairly straightfoward way. Two of the requirements are stickiness support (always send a request for a given session to the same backend) as well as multiple load balancers running at the same time to avoid single point of failure (hotbackup with only one haproxy running at a time is not considered acceptable). Using multiple HAproxy instances in parallel with stickiness support looks relatively easy if cookies are allowed (through e.g. cookie prefixing) since no information needs to be shared. Unfortunately, we also need to support session id embedded in URL (e.g. http://example.com/foo?sess=someid), and I was hoping that the new sticky table replication in 1.5 could help for that, but I am not sure it is the case. As far as I understand, I need to first define a table with string type, and then use the store-request to store the necessary information. I cannot see a way to get some information embedded in the URL using the existing query extraction methods. Am I missing something, or is it difficult to do this with haproxy ? regards, David
Re: Multiple Load Balancers, stick table and url-embedded session support
On Thu, Dec 9, 2010 at 7:27 PM, Hank A. Paulson h...@spamproof.nospammail.net wrote: Please see the thread: need help figuring out a sticking method I asked about this, Willie says there are issues figuring out a workable config syntax for 'regex to pull the URL/URI substring' but (I think) that coding the functionality is not technically super-difficult just not enough hands maybe and the config syntax? Actually if the key is to taken from a query param, that is relatively easy enough (I coded something myself for a client some time back based on 1.3.15.4). If, however, more flexibility is required (like in your case), then the point that Willie has mentioned will definitely come into play. -jf I have a feeling this would be a fairly commonly used feature, so it is good to see others asking the same question :) How are you planning to distribute the traffic to the different haproxy instances? LVS? Some hardware? On 12/8/10 8:58 PM, David wrote: Hi there, I have been asked to design an architecture for our load-balancing needs, and it looks like haproxy can do almost everything needed in a fairly straightfoward way. Two of the requirements are stickiness support (always send a request for a given session to the same backend) as well as multiple load balancers running at the same time to avoid single point of failure (hotbackup with only one haproxy running at a time is not considered acceptable). Using multiple HAproxy instances in parallel with stickiness support looks relatively easy if cookies are allowed (through e.g. cookie prefixing) since no information needs to be shared. Unfortunately, we also need to support session id embedded in URL (e.g. http://example.com/foo?sess=someid), and I was hoping that the new sticky table replication in 1.5 could help for that, but I am not sure it is the case. As far as I understand, I need to first define a table with string type, and then use the store-request to store the necessary information. I cannot see a way to get some information embedded in the URL using the existing query extraction methods. Am I missing something, or is it difficult to do this with haproxy ? regards, David
Re: Multiple Load Balancers, stick table and url-embedded session support
On 12/09/2010 08:27 PM, Hank A. Paulson wrote: Please see the thread: need help figuring out a sticking method I asked about this, Willie says there are issues figuring out a workable config syntax for 'regex to pull the URL/URI substring' but (I think) that coding the functionality is not technically super-difficult just not enough hands maybe and the config syntax? I have a feeling this would be a fairly commonly used feature, so it is good to see others asking the same question :) My use-case is pretty simple, since it was fullfilled without stick table using the appsession configuration parameter, e.g. appsession MYSESSIONID len 64 timeout 1h request-learn mode query-string IOW, I only need simple string matching, and that maybe be an acceptable first step ? How long do you think it would take ? I am relatively familiar with C, but have no knowledge of network programming nor I have ever looked into haproxy source code. How are you planning to distribute the traffic to the different haproxy instances? LVS? Some hardware? I don't know exactly - I think using somekind of DNS round robin scheme between our set of load balancers (we have something similar a the moment with pound as load balancer, but without any kind of sticky session support). We are required not to use hardware. cheers, David
Re: Multiple Load Balancers, stick table and url-embedded session support
Hi Jeffrey, On 12/09/2010 10:13 PM, Jeffrey 'jf' Lim wrote: On Thu, Dec 9, 2010 at 7:27 PM, Hank A. Paulson h...@spamproof.nospammail.net mailto:h...@spamproof.nospammail.net wrote: Please see the thread: need help figuring out a sticking method I asked about this, Willie says there are issues figuring out a workable config syntax for 'regex to pull the URL/URI substring' but (I think) that coding the functionality is not technically super-difficult just not enough hands maybe and the config syntax? Actually if the key is to taken from a query param, that is relatively easy enough (I coded something myself for a client some time back based on 1.3.15.4). Would that be something you could and would be willing to share ? regards, David