Perlbal's meant to keep a disconnection between client and backend.> On Tue, Jul 10, 2012 at 1:17 PM, sawyer x <xsaw...@gmail.com> wrote:
>
> Is there a suggested way to pick a backend to which a client will connect?
> (even if it's still in "pending_connects" or not present either in "pending_connects" nor in "bored_backends")
Strongarming it may not work terribly well...
It's not clear if you're trying to connect it to a specific server, or
literally a specific connection to a specific server? If the former, you
can set up one pool per server and use a selector to assign the client.
> On Tue, Jul 10, 2012 at 10:23 PM, dormando <dorm...@rydia.net> wrote:I get that; except perlbal was designed specifically for the case of
> > On Tue, Jul 10, 2012 at 1:17 PM, sawyer x <xsaw...@gmail.com> wrote:
> >
> > Is there a suggested way to pick a backend to which a client will connect?
> > (even if it's still in "pending_connects" or not present either in "pending_connects" nor in "bored_backends")
>
> Perlbal's meant to keep a disconnection between client and backend.
> Strongarming it may not work terribly well...
>
>
> Yet, in the matter of a sticky session or reproxying, there's a purpose to connecting the two.
sticky sessions being a bad idea.
> It's not clear if you're trying to connect it to a specific server, orIf you do the pool trick I mentioned above, it should work fine. You can
> literally a specific connection to a specific server? If the former, you
> can set up one pool per server and use a selector to assign the client.
>
>
> I want to be able to implement a sticky session. Send a user a header which relates to a specific server (so far so good) and when the user comes
> in, to get them to get *that* specific server (as long as it's in the pool of the server the user is going to).
>
> I was able to accomplish it but it a pretty gross way of either playing with bored_backends or creating a new connection assign the client to. Any
> help to make it cleaner would be greatly appreciated! :)
look at the selector examples and pick one that can examine session
cookies and direct them back to a particular service, which has a
particular pool. then you end up with one service/pool per server...
If you do the pool trick I mentioned above, it should work fine. You can
look at the selector examples and pick one that can examine session
cookies and direct them back to a particular service, which has a
particular pool. then you end up with one service/pool per server...
I could try and create pools on start-up for each server (pool name would be the server's hashed ID) and then have the request forward it to the proper pool. Unfortunately the documentation is scarce. Any quick tips or references for either creating pools (via code) and/or assign clients to them from hooks?
Ding? Bit wasteful but oh well.
I want to be able to implement a sticky session. Send a user a header which relates to a specific server (so far so good) and when the user comes in, to get them to get *that* specific server (as long as it's in the pool of the server the user is going to).
This really sounds like a software design problem.On Tue, Jul 17, 2012 at 9:34 AM, sawyer x <xsaw...@gmail.com> wrote:
> On Tue, Jul 17, 2012 at 5:20 PM, Bill Moseley <mos...@hank.org> wrote:
>> Quick question:
>>
>> Why do you need sticky sessions? Why is it necessary that a user uses the
>> same machine for every request?
>
>
> Multiple backends that do not share the same session data.
>
> Not everyone has a LAN setup, and an NFS or Riak or CouchDB or whatever for
> their session data. If you go to a different backend, you lose the session.
Perhaps you could
consider using memcache with SASL to store session data for all
backends.
The problem is latency, not the storage method. I can use Memcache, Riak, CouchDB or others, but it doesn't change the latency problem between them. Actually, it adds an additional problem (which is especially evident in CouchDB) of making sure you collate the session data from different workers correctly. We've actually tried all those I've mentioned (and more) and had these problems.