views:

115

answers:

2

Problem: I have a server farm which uses non-sticky IP's and a Session Server to maintain sessions for all the servers. So it doesn't matter which server a client comes back to because the server will always go to the Session Server to get that client's session data. When I take the Session Server down all the servers lose their session data.

One of the solutions to this problem is to use SQL Server as the Session Server. This unfortunately is not possible.

So I'm thinking in terms of Memcached. If I managed my session using memcached I still have the problem that session will be lost if I take one of the memcached servers down. However, if I could issue a call against that server saying "redistribute your cache to the other servers" then this should solve the problem.

How would you redistribute memcached's cache from a server being taken down to other servers?

+1  A: 

I'm not sure there's such a feature in memcached. But, the point is, it's cache. The worst that can happen if a server goes down or restarts is that you get some cache misses (until it's rebuilt). Memcached isn't supposed to be a reliable DB (though there is a DB based on memcached) - your data should be kept in some lower persistent level as well and you shouldn't sweat it when a cache server goes down every once in a while as long as it doesn't invalidate your entire cache and doesn't happen too often.

Assaf Lavie
A: 

Have you considered using SQL Server to maintain the session state?

Using SQL Server for ASP.Net session state

ASP.NET Session State (MSDN)

Dan Atkinson