RE: CPU usage @5% during 2 minutes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>How any rows are you pulling from the database?  
aprrox. 12.000 but there are only around 50-100 new rows at a maximum
within a day, and there were almost as many before the problem appeared.
>
>What's the very last part of the code:  .$_OR?> 

There is a switch, some echoes and a db_close;

>
>Have you tried this code in a separate script to test it's performance
>individually?
Yes, then it performs good.
This seems to be strange and irrelevant to me, because placing a 
$tmpsting .= microtime()."<br>\n"; into each loop and then echoing it
shows, that there are randomly processing gaps between two cycles when
running as a part of the whole.


>
>> -----Original Message-----
>> 
>> The sample code (in seperate, this piece of code runs with 
>> normal speed,
>> but it is this part which runs slowly when executed as a whole,
>> everything else is fast):
>> 
>> 
>>       $sqlquery = "SELECT sh_Number, sh_Status FROM 
>> service_sheet ORDER BY
>> sh_Number DESC";
>>       $result = mysql_query($sqlquery)
>>       or die (mysql_error()."<br><br>"._ERROR_QUERY.": ".$sqlquery);
>>       echo " <SELECT 
>> onchange=\"this.form.service_sheet_worknum.value =
>> this.value;\" class=\"service_sheet_list\" name=\"service_sheet\">";
>>       while (list($shID, $shStatus, $shWNum, $custName) =
>> mysql_fetch_row($result)) {
>>               switch ($shStatus) {
>>               case 1:
>>                       $option_class = "status_1";
>>                       break;
>>               case 2:
>>                       $option_class = "status_2";
>>                       break;
>>               case 3:
>>                       $option_class = "status_3";
>>                       break;
>>               case 4:
>>                       $option_class = "status_4";
>>                       break;
>>               case 5:
>>                       $option_class = "status_5";
>>                       break;
>>               }
>>               echo "<OPTION class=\"$option_class\" 
>> value=\"$shID\">$shID</OPTION>";
>>               }
>>        echo "</SELECT>&nbsp;&nbsp;&nbsp;&nbsp;"._OR;?>
>> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux