Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

In a scenario where an application is hosted by multiple instances in Amazon EC2 (with load balancing), are multiple requests from the same user guaranteed to go to the same instance?

share|improve this question
    
I guess it depends on your load balancing mechanism\method and what type of affinity is in use. Can you elaborate on your setup? –  joeqwerty Jun 16 '10 at 0:11
    
Sorry, don't have a setup yet -- Just wondering if I am forced to store session state in a database or if I can get by maintaining session state in memory. –  George W Bush Jun 16 '10 at 0:11
add comment

2 Answers

up vote 5 down vote accepted

From the Amazon Elastic Load Balancing summary page:

Elastic Load Balancing supports the ability to stick user sessions to specific EC2 instances.

share|improve this answer
add comment

It depends on your configuration. I don't make use of Amazon's Elastic Load Balancing (ELB) service as it doesn't allow me to log the client IP address as all connections appear to come from the LB equipment when seen by the EC2 instance. Instead I do my own load balancing via DNS and multiple Apache front-end servers that are setup to use sticky sessions from the same originating source address.

share|improve this answer
    
Jeremy, Thanks for the detailed answer. –  George W Bush Jun 16 '10 at 2:12
    
Don't mention it. I've been running several java application servers under EC2 for almost a year now. –  Jeremy Bouse Jun 16 '10 at 3:49
add comment

Your Answer

 
discard

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.