Is there a way to detect when a server is overloaded?
It's easy to get the server average load .. but this number means almost nothing to a php script because its very dependent on the number of CPUs the server has.
What I'm looking for is a way to add a condition to a page that requires a lot of resources like a db search page, this condition will stop the page and display some error message if the server load is high.
detecting server 'over'load
Moderator: General Moderators
Re: detecting server 'over'load
Couldn't you measure server load by the number of connections to the database? Lower the number of allowed connections far enough and the mysql_connect call will fail if the server is "overloaded".
Re: detecting server 'over'load
It's a very good idea, tasairis. i'll research it.
But i guess it's a little difficult to implement in a shared hosting environment, and with a commercial script that will run on different types of configurations.
But i guess it's a little difficult to implement in a shared hosting environment, and with a commercial script that will run on different types of configurations.