This Question have no Text answers yet!

How does global.asax function in server farm?

By : chobo
Source: Stackoverflow.com
Question!

I'm confused as to how the global.asax file would run in a server farm. Does each server have its own instance running or is it a shared instance.

For example in my global.asax in the Application_Start event I initialize a singleton object that collects stats and updates a database table containing the stats. Which of the following happens?

Scenario One

  • Server 1 -> (Stat = 10) -> Updates database with 10
  • Server 2 -> (Stat = 8) -> Updates database with 8
  • Server 3 -> (Stat = 25) -> Updates database with 25
  • Server 4 -> (Stat = 5) -> Updates database with 5

It the first example each server would update the database with it's own collection

Scenario Two

  • Server 1 -> (Stat = 10) -> Updates database with 10
  • Server 2 -> (Stat = 10) -> Updates database with 10
  • Server 3 -> (Stat = 10) -> Updates database with 10
  • Server 4 -> (Stat = 10) -> Updates database with 10

It the above example the servers have access to the same collection. Is this possible?

By : chobo


Video about How does global.asax function in server farm?