471,591 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,591 software developers and data experts.

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
1 1576
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
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.