First of all, I am talking about a server that host my website.
So, I noticed on my cPanel specs some minutes ago that my CPU usage is nearly 100% (I have a range to 80-95% ). On the other hand, my memory usage is 5-10%.
I am wondering if this server will be crashed on the future. e.g. With CPU usage = 100% what will gonna happend? Will this server may crash or not?
I notice that this cpu usage is because I am running a ajax script that it is refresh a div every 5 seconds. The content of this div is a String from 3 random arrays that they are created every 5 sec.
Moreover, I use many variables - arrays on my code (php code) and I am wondering if I must flush these variables. eg
<html>
<?
$variable1 == something
$variable2 == something
$variable3 == something
?>
</html>
<? flush($variable1) ?>
Is nessacary to do this on php (like on C++ ) ? or php has any Auto Garbage collector like Java?
EDIT: Ajax Scritp that im using
index.html
<html>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script>
<script type="text/javascript">
var auto_refresh = setInterval(
function ()
{
$('#autoRefreshDiv').load('autoRefreshDiv.php').fadeIn("slow");
}, 5000); // refresh every 5000 milliseconds
</script>
<body>
<div id="autoRefreshDiv"></div>
</body>
</html>
autoRefreshDiv.php
<?
$array1 = array("something1", "something2");
$array2 = array('something3','something4');
$array3 = array('something5','something6');
shuffle($array1);
shuffle($array2);
shuffle($array3);
echo $array1[0].'.....'.$array3[0].'.....'.$array2[0] ;
?>