2

We have 2 web servers load balanced and we wanted to get away from sticky sessions for obvious reasons. Our attempted approach is to use the ASP.NET State service on one of the boxes to store the session state for both. I realize that it's best to have a server dedicated to storing sessions but we don't have the resources for that.

I've followed these instructions to no avail. The session still isn't being shared between the two servers.

I'm not receiving any errors. I have the same machine key for both servers, and I've set the application ID to a unique value that matches between the two servers. Any suggestions on how I can troubleshoot this issue?

Update:

I turned on the session state service on my local machine and pointed both servers to the ip address on my local machine and it worked as expected. The session was shared between both servers. This leads me to believe that the problem might be that I'm not using a standalone server as my state service. Perhaps the problem is because I am using the ip address 127.0.0.1 on one server and then using a different ip address on the other server. Unfortunately when I try to use the network ip address as opposed to localhost the connection doesn't seem to work from the host server. Any insight on whether my suspicions are correct would be appreciated.

Shawn
  • 21
  • 3

1 Answers1

0

If you want the best of both worlds you should take a look at the Windows AppFabric service(s). They provide a caching mechanism with a direct session state provider for ASP.NET. This allows you to spin up in-memory distributed caches among your web servers and utilize them for potential failover and session state storage. Its much faster than either a state server or a SQL backend and has all the benefits of being in-memory and on the web servers themselves.

Brent Pabst
  • 6,059
  • 2
  • 23
  • 36