HighTechTalks DotNet Forums  

Application state - should I do this?

ASP.net Caching microsoft.public.dotnet.framework.aspnet.caching


Discuss Application state - should I do this? in the ASP.net Caching forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
 
Posts: n/a

Default Application state - should I do this? - 06-26-2005 , 11:47 AM






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

--




Reply With Quote
  #2  
Old   
Scott Allen
 
Posts: n/a

Default Re: Application state - should I do this? - 06-26-2005 , 09:04 PM






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!

--
Scott
http://www.OdeToCode.com/blogs/scott/


On Sun, 26 Jun 2005 23:47:28 +0800, <dl> wrote:

Quote:
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


Reply With Quote
  #3  
Old   
 
Posts: n/a

Default Re: Application state - should I do this? - 06-26-2005 , 10:08 PM



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?

"Scott Allen" <scott (AT) nospam (DOT) odetocode.com> wrote

Quote:
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!

--
Scott
http://www.OdeToCode.com/blogs/scott/


On Sun, 26 Jun 2005 23:47:28 +0800, <dl> wrote:

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




Reply With Quote
  #4  
Old   
Scott Allen
 
Posts: n/a

Default Re: Application state - should I do this? - 06-27-2005 , 10:08 AM



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.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Mon, 27 Jun 2005 10:08:19 +0800, <dl> wrote:

Quote:
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?



Reply With Quote
  #5  
Old   
 
Posts: n/a

Default Re: Application state - should I do this? - 06-27-2005 , 12:07 PM



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?

"Scott Allen" <scott (AT) nospam (DOT) odetocode.com> wrote

Quote:
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.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Mon, 27 Jun 2005 10:08:19 +0800, <dl> wrote:

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?





Reply With Quote
  #6  
Old   
Scott Allen
 
Posts: n/a

Default Re: Application state - should I do this? - 06-28-2005 , 09:05 PM



On Tue, 28 Jun 2005 00:07:48 +0800, <dl> wrote:

Quote:
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.

--
Scott
http://www.OdeToCode.com/blogs/scott/


Reply With Quote
  #7  
Old   
 
Posts: n/a

Default Re: Application state - should I do this? - 07-03-2005 , 11:48 AM



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

"Scott Allen" <scott (AT) nospam (DOT) odetocode.com> wrote

Quote:
On Tue, 28 Jun 2005 00:07:48 +0800, <dl> wrote:

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.

--
Scott
http://www.OdeToCode.com/blogs/scott/



Reply With Quote
  #8  
Old   
Scott Allen
 
Posts: n/a

Default Re: Application state - should I do this? - 07-03-2005 , 01:49 PM



On Sun, 3 Jul 2005 23:48:15 +0800, <dl> wrote:

Quote:
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/quickst...eoverview.aspx

--
Scott
http://www.OdeToCode.com/blogs/scott/


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.