Hi Gabriel,

  I've read that HAProxy is capable of keeping a set of http request
directed to the same webserver. (I think the feature is called 'Sticky
Session' on Websphere Cluster)

  I've seen this in the documentation :

appsession <cookie> len <length> timeout <holdtime>
>
>            [request-learn] [prefix] [mode <path-parameters|query-string>]
>  * Define session stickiness on an existing application cookie.*
>
>
I'm just looking for some howto/best practices on this subject.

Also the shared session with memcache can be a valid option. (I've to dig
this subject).

So, can anyone confirm that it's possible or not possible to have a "sticky
session" feature with HAProxy  ?
If possible : howto/best practice?
If not : well I'll try the memcache solution ;)

Thanks for your help,
Regards,
Thomas.



On Fri, Mar 11, 2011 at 16:19, Gabriel Sosa <[email protected]> wrote:

> this is not an HAProxy related problem
>
> What you need is to share the session across all webservers. You have
> several ways to do it: memcache, redis, db, filesystem.
>
> We currently are using memcache for this
>
> check your php.ini for "session.save_handler"
>
> we have something like:
>
> session.save_handler = memcache
> session.save_path = "tcp://mmc-server-01:11211,tcp://mmc-server-02:11211"
>
> some more info: http://php.net/manual/en/session.configuration.php
>
> Once you do this, haproxy will keep using the same algorithm  to balance
> but webservers will be able to find/reuse the session users were on.
>
> Saludos
>
>
>
> On Fri, Mar 11, 2011 at 11:37 AM, Thomas Manson <
> [email protected]> wrote:
>
>> Hi,
>>
>>   I've setup HAProxy to loadbalance the traffic across two web servers
>> that runs some PHP website (based on JOOMLA, OSCommerce and some other
>> solution)
>>
>>   However I've noticed that the session affinity is not working Out Of The
>> BOX (which after 2sec of think is quite logical ;))
>>
>>   Does anybody have some pointers to configure HAProxy (and if necessary
>> PHP) to make this work ?
>>
>> Thanks,
>> Thomas.
>>
>
>
>
> --
> Gabriel Sosa
> Si buscas resultados distintos, no hagas siempre lo mismo. - Einstein
>

Reply via email to