If we scale up (add an instance to ELB), could we redirect some existing requests to the new instance. So that, The users that we force to a new server will be asked to login again
If we scale down (remove an instance from ELB), then all users from that server will automatically be redirected by ELB to other remaining servers. These user should not be aked to login again.
Is this possible (including the redirect of request)? How?
Any ideas are welcome but I presume this can be solved using a central session store. I just don't know how to implement it .
And what are the options in using a central session store? simpledb? redis? memcached?
UPDATED:
Our application is just a simple web application hosted in apache. We have two instances of it added unto the Amazon ELB, and we are using PHP.
Any ELB php specific suggestions? when a scale down/up happens that no user-visible symptomps should be shown?
Yes, you can solve all those problems and more with the use of a centralised session store. Without knowing your application, it's impossible to point you at a definitive guide for implementing it (and it would be a Stack Overflow question anyway), but it's usually as simple as either setting an option (in frameworks like Rails) to writing a few lines of glue code that get called by the web framework and which connects to the store to store the details or retrieve them.
As far as what to use, I recommend Redis. While memcached would appear to do the trick, it has the unpleasant downside of requiring users to re-login whenever you need to restart your memcached instance(s). A good rule of thumb to follow in redundant systems is that no change to your infrastructure should show any user-visible symptoms. Redis, on the other hand, persists to disk, is blazingly fast both on update and retrieval, and has shown itself to be incredibly robust in the large-scale situations I've used it in.