
Originally Posted by
cmiddlebrook
I have a feeling it is just a problem with the company I am using because they support system seems very poor but they keep trying to tell me that the sites are simpy doing too much
Unfortunately the truth is right in the middle, meaning that Pligg has some queries that can cause heavy load on the servers.
Here's 1 thread about it:
SQL Query Caused the Load on Server
(only shows the SQL query, but you'll get the idea)
Here's another thread:
Pligg Page Load Speed Issue
Unfortunately the real solution is figuring out which exact queries cause the heavy load on the server and then try to make the load on the server less impact.
I do have a piece of code for a Database class, but it doesn't fit the current class at the moment.
Therefore it's semi-code:
Code:
$limit_query_time = '0.001'; //change this value if necessary
$query_time = 0;
$query_error = NULL;
$query_message = NULL;
// You need a timer class for this piece of code
$this->startTime('query_time', false);
$result =& mysql_query($sql, $this->conn);
$this->stopTime('query_time');
$query_time = sprintf('%f', $this->dumpTime('query_time'));
// So ... now you know how long the query took
if ($query_time > $limit_query_time)
{
$query_error = sprintf('QUERY TAKING MORE THAN %f SECONDS',$limit_query_time);
$query_message = $query_time;
} You can also put those long queries into a log. Thing is that you need to analyze the query (use MySQL DESCRIBE statement) and then post on the forum