Tuesday, January 25, 2011

Amazon EC2 - Are multiple requests from the same user guaranteed to go to the same instance?

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?

  • From the Amazon Elastic Load Balancing summary page:

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

  • 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.

    hamlin11 : Jeremy, Thanks for the detailed answer.
    Jeremy Bouse : Don't mention it. I've been running several java application servers under EC2 for almost a year now.

0 comments:

Post a Comment