Monday, March 12, 2012

Web Farm question.

We are trying to run an application on a web farm, with sql server state
management, the issue is that the application uses a singleton static
class to access configuration information.

The issue is that when the state of the object can be different on
different web servers , is there any mecahnism in ASP.NET, like storing
something in the Application object, which can help in synchronizing
this class across web servers ?

any help would be greatly appreciated.

regards
-ashishthe short answer is no, other than always loading the data from the state
server.

but with sqlserver you can use its notification services to implement a
trigger for the singleton.

in the past i've implemented a distributed lock manager to maintain
configuration state across a web farm. i use udp for the keepalive and
quorum votes. to update data, the master node takes a update lock, (which
invalids the data on the slaves), updates it data, and releases the lock.
the lock release, the slaves know their copy is invalied and will all
refetch the data from the master (or its source).

-- bruce (sqlwork.com)

"ashish" <ashish@.mailmenot.com> wrote in message
news:%237M1NjEIFHA.980@.TK2MSFTNGP12.phx.gbl...
| We are trying to run an application on a web farm, with sql server state
| management, the issue is that the application uses a singleton static
| class to access configuration information.
|
| The issue is that when the state of the object can be different on
| different web servers , is there any mecahnism in ASP.NET, like storing
| something in the Application object, which can help in synchronizing
| this class across web servers ?
|
| any help would be greatly appreciated.
|
| regards
| -ashish
well if you are using sql server to begin with, why not store the
configuration information in the database? That would seem a reasonable,
scalable approach to me. Config files are machine specific by default and
application specific in the extreme. Either way, it doesn't bode well for
web farm type scenarios. That's about all i can think of at this point, if
the light comes on later, i'll be sure to post something.

--
Regards
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
----------------

"ashish" <ashish@.mailmenot.com> wrote in message
news:%237M1NjEIFHA.980@.TK2MSFTNGP12.phx.gbl...
> We are trying to run an application on a web farm, with sql server state
> management, the issue is that the application uses a singleton static
> class to access configuration information.
> The issue is that when the state of the object can be different on
> different web servers , is there any mecahnism in ASP.NET, like storing
> something in the Application object, which can help in synchronizing this
> class across web servers ?
> any help would be greatly appreciated.
> regards
> -ashish
What about using the Cache class for that? Need to check right now, but I
believe that will work between computers

Need to check, and I'll post some code later on.

"ashish" wrote:

> We are trying to run an application on a web farm, with sql server state
> management, the issue is that the application uses a singleton static
> class to access configuration information.
> The issue is that when the state of the object can be different on
> different web servers , is there any mecahnism in ASP.NET, like storing
> something in the Application object, which can help in synchronizing
> this class across web servers ?
> any help would be greatly appreciated.
> regards
> -ashish
yup you could but it requires a change to the config file to force the
servers in the farm to have the same machine authentication key, then you
would need to remove the isolateapps section of the config file - that
modication was introduced in 1.1, it does not exist for 1.0. If memory
serves me, it is the machinekey node in the machine config file that you
need to address.

--
Regards
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
----------------

"Albert Pascual" <AlbertPascual@.discussions.microsoft.com> wrote in message
news:731E7C8A-99E4-4E26-984D-5E87D7694C0C@.microsoft.com...
> What about using the Cache class for that? Need to check right now, but I
> believe that will work between computers
> Need to check, and I'll post some code later on.
> "ashish" wrote:
>> We are trying to run an application on a web farm, with sql server state
>> management, the issue is that the application uses a singleton static
>> class to access configuration information.
>>
>> The issue is that when the state of the object can be different on
>> different web servers , is there any mecahnism in ASP.NET, like storing
>> something in the Application object, which can help in synchronizing
>> this class across web servers ?
>>
>> any help would be greatly appreciated.
>>
>> regards
>> -ashish
>
Great, that's what I wanted to know. So If they have the sames config file
with the same authentication key Cahe will be global.

Thanks so much for your response!

Al

"Alvin Bruney [Microsoft MVP]" wrote:

> yup you could but it requires a change to the config file to force the
> servers in the farm to have the same machine authentication key, then you
> would need to remove the isolateapps section of the config file - that
> modication was introduced in 1.1, it does not exist for 1.0. If memory
> serves me, it is the machinekey node in the machine config file that you
> need to address.
> --
> Regards
> Alvin Bruney
> [Shameless Author Plug]
> The Microsoft Office Web Components Black Book with .NET
> available at www.lulu.com/owc
> ----------------
>
> "Albert Pascual" <AlbertPascual@.discussions.microsoft.com> wrote in message
> news:731E7C8A-99E4-4E26-984D-5E87D7694C0C@.microsoft.com...
> > What about using the Cache class for that? Need to check right now, but I
> > believe that will work between computers
> > Need to check, and I'll post some code later on.
> > "ashish" wrote:
> >> We are trying to run an application on a web farm, with sql server state
> >> management, the issue is that the application uses a singleton static
> >> class to access configuration information.
> >>
> >> The issue is that when the state of the object can be different on
> >> different web servers , is there any mecahnism in ASP.NET, like storing
> >> something in the Application object, which can help in synchronizing
> >> this class across web servers ?
> >>
> >> any help would be greatly appreciated.
> >>
> >> regards
> >> -ashish
> >>
>

0 comments:

Post a Comment