Application state - should I do this?

G

Guest

Hi
I have an application running on two different web servers (as a backup of
each other but not in cluster mode) with SSL enable. The DNS will serve the
web servers in a round robin fashion, say I will have www.<a_domain>.com
point to www1.<a_domain>.com and www2.<a_domain>.com. I am thinking to use
an application level variable on each server to remember which web server
was last served and then the next one will be served, ie.

if (application.Get(lastServer).ToString() = "www1.<a_domain>.com")
response.redirect(https://www2.<a_domain>.com/main.aspx);

Should I do somethind like this? Is there any issue / problem you see?

TIA

--
 
S

Scott Allen

I'd avoid this approach - by the time you send a response back to the
client and have the client return to the other server, you might have
had time to finish processing the first request.

Before you make any changes to improve performance I'd run some tests
and get some benchmark performance numbers to measure against - you
might even find out your app meets all the performance requirements!
 
G

Guest

the reason I want to do this is to avoid user session being redirect to a
different web server and this would cause a problem with the SSL, wouldn't
it?
 
S

Scott Allen

Two options come to mind for SSL:

One is to get a 'wildcard certificate', this is where the SSL cert has
an * in the left most part of the common name (w*.odetocode.com would
match www1.odetocode.com and www2.odetocode.com), and load balancing
works.

Another option is to buy one of the many hardware load balancers that
support 'stick SSL sessions'. It will keep SSL clients returning to
the same server.
 
G

Guest

For option One, have you tried this 'wildcard certificate' before? will it
works? In addition to this, I guess I will have to configure cookieless =
true. Right?
 
S

Scott Allen

For option One, have you tried this 'wildcard certificate' before? will it
works? In addition to this, I guess I will have to configure cookieless =
true. Right?

Yes - wildcard certificates do work. You could always generate your
own cert with Windows certificate services to try it out in your
specific environment.

Are you setting cookieless for session state? In a clustered
environment what you'll need to do is use an ASP.NET State service or
store session data in the database - the cookies will be fine, though.
 
G

Guest

Hi Scott
Sorry that I have left this thread for couple days. I have setup a
default.htm to do the redirect to "https://...", it works but this is not my
prefer setup!
Can you point me to some reference on this State service? database would be
too costly at this stage :(
TIA
 
S

Scott Allen

Hi Scott
Sorry that I have left this thread for couple days. I have setup a
default.htm to do the redirect to "https://...", it works but this is not my
prefer setup!
Can you point me to some reference on this State service? database would be
too costly at this stage :(
TIA

Setting up the state service is pretty straightforward - it's
modifying web.config and starting an installed service. See about half
way through the following article for more detail:
http://samples.gotdotnet.com/quickstart/aspplus/doc/stateoverview.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,268
Latest member
AshliMacin

Latest Threads

Top