Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a web application written in mvc2. Currently hosted on amazon cloud ec2. Because of growing traffic we want move multi instance enviorenment. I have a custom session class which currently initiate at session start (global asax) and i am using via getter or setter class in application. Because of multi instance chore i have to handle hole security architecture. I am looking a better way to handle this problem.

I am looking for good implementation of session and how to apply on amazon ec2 multi instance environment. What is road blocks for system architecture?

share|improve this question
up vote 1 down vote accepted

We have our web app running on EC2, but its a basic ASP.NET App, not MVC. We got around the session state issue by pointing both of our servers to to a SQL box, which they where going to talk to anyway, and used that for Session State. Another option is to use something like Memcached or Membase as your session state, and share the state across multiple machines that way.

The only obstacle i can think of is around naming of machines. Each instance will change when they reboot, so what you would need to do is something as follows:

  • setup a master memcache or membase server. this should set a DNS record for itself on boot.
  • on machine start, get the current instance ip address, and register it with either memcached or membase (membase i think is easier for this).
  • on shut down, disconnect from the master server.

there is a Memcached Session State and Cache Provider on CodePlex which should easily help you do what you need to do.

Again, the way we got around it was SQL server... This was easier for us to setup, but i am not ruling out a memcache/membase option any time soon either...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.