detect high server load and switch to text only mode

  • Thread starter thomasamillergoogle
  • Start date
T

thomasamillergoogle

I have a site that sometimes gets extremely high server loads. I would
like to make it so if the sustained server load is very high (million
page views per hour) then it will switch to text only mode. My question
is, what is the most reliable way to detect page views per hour
programatically. I do NOT want to read the IIS logs. But
writing/reading performance stats from performance counter is ok. I
also do not want to slow down the server by inserting a sql record for
every page view!! that would be counter productive!
 
G

Guest

A pretty "reliable" way is to keep either a static set of counter variables
in Global class (global.asax) or even store them in Application State. You
could have a lastUpdateTime and a StartTime and get your "counts per hour"
with a simple formula. Each hour, you could reset the StartTime and so you
would have a reasonably reliable way to know how many requests per hour. Use
the Application_BeginRequest event to increment your counter.
Peter
 
G

Guest

(e-mail address removed) wrote in @g43g2000cwa.googlegroups.com:
I have a site that sometimes gets extremely high server loads. I would
like to make it so if the sustained server load is very high (million
page views per hour) then it will switch to text only mode. My question
is, what is the most reliable way to detect page views per hour
programatically. I do NOT want to read the IIS logs. But
writing/reading performance stats from performance counter is ok. I
also do not want to slow down the server by inserting a sql record for
every page view!! that would be counter productive!


I would use an application variable in the global.asax to track the number
of users (Session_Start/session_end).

You could also use WMI to retrieve server stats.
 

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

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top