views:

65

answers:

3

how to create a performance management system that adjust available services based on current load? any idea

lets say I have too many people accessing one page of my website ? how can I build a system which can disable some services for a while (automatically) to save the server from being dawn.

because some services parts of the website should always be online

I have explained, the question clearly, I think :)

A: 

You don't really give enough information in your question as to the environment your talking about. So I'll make a few assumptions - you're talking about a web server/application of some kind, and you have >1 servers. The basic method is to designate one server as the initial point of contact for each request - that server is the load balancer, and it decides based on your criteria which of your servers should service that request.

The simplest routing from your LB would be to balance the number of users/sessions evenly between each physical server. The dispatcher code, is basically keeping a count of users and routing to keep those counts as even as possible. If you could monitor the load on each server and potential judge the probable load from a user, then your routing algorithm can be much more complex.

Another way of doing this is to use virtual machine images that can then be hosted accross multiple physical servers. There is a high end commercial solution from VMWare that does this, but does need human intervention.

Another approach is to code against 'the cloud' where you can host your app with Amazon, google etc and they can provide more capacity on the fly. Also most ISPs will provide a virtualised server environment to support peak loads - really useful in ticketing applications.

IMHO it's not easy to create a good load balancer from scratch, if you're trying to do this in a big production environment then a commercial solution makes more sense in the long run.

MrTelly
A: 

If you really want to provide high availability of web pages you need to investigate a web farm. You wouldn't normally write something like this, unless you are, say Google!

IIS 6.0 contains the ability to enable bandwidth throttling, but only at the web site level, not individual pages:

You could perhaps split out some pages into their own web site? I'm not sure how feasible that is in your situation.

Mitch Wheat
A: 

Quick & Dirty solution:

1) Create some kind of system to measure the load. For example you can use Session_Start and Session_End events in Global.asax to count number of active users. If you are using some other system than IIS / .net then you can use some other kind of method like how many times page is hit within last 15 minutes. In .net you can access also performance monitors directly.

2) When the activity is above limits you can disable some services.

Please give more specific information about your system.