Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Support of memcached #29
Here is a way to share sessions between different hosts using memcached. There are two major drawbacks:
So, this is just a proof of concept.
This is an interesting concept. I had thought about extending the session cache to a networked database so that ssl sessions could fail over with the load balancer as necessary. I usually run load balancers in active/backup mode, so I was more interested in using a database with replication (something like tokyo tyrant). In this context, a standard memcached would be a single point of failure. However, tokyo tyrant supports the memcache protocol (with some overheard) so all is not lost. I'll have to test out your memcache extensions in this context.
So, I've thought about this quite a bit, and how to get around the "session retrieval cannot block" problem...
My idea is to use something like redis pub/sub using hiredis.
.. this would create quite a busy gossip channel between N children on M machines--but redis (for example) can push 100k messages a second or so, which is quite a bit of headroom. And it avoids blocking the main thread on a network request.
I have an early version of this that isn't quite working yet, but it's the best I've come up with yet.
That being said, I'm reluctant to pull in anything that would block stud's I/O thread--that pretty much entirely defeats the execution model.