467,927 Members | 1,827 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,927 developers. It's quick & easy.

detect high server load and switch to text only mode

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!

Jan 2 '06 #1
  • viewed: 1505
Share:
1 Reply
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

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"th*****************@yahoo.com" wrote:
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!

Jan 2 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

17 posts views Thread by Guyon Morée | last post: by
2 posts views Thread by Jürgen Holly | last post: by
3 posts views Thread by ewunia | last post: by
10 posts views Thread by Kenneth Brody | last post: by
1 post views Thread by mrjaune | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.