High cpu usages

Status
Not open for further replies.

whinis

New Member
Prime Account
Messages
29
Reaction score
0
Points
0
I got suspended for High Cpu usages however my site is not very popular and all my scripts have been stress tested on my own computer and not raising my cpu or ram amount by more that 3%( with 14 people viewing).

I am not sure why I all of a sudden have high CPU usage when my logs show only 15 people at max per month.

can anyone clarify?
 

adamparkzer

On Extended Leave
Messages
3,745
Reaction score
81
Points
0
Your account isn't suspended

He may have already unsuspended himself. o_O

If you have absolutely no clue which scripts are causing this problem, there are administrators than can identify the source of the problem and could help you prevent further high system resource suspension.
 

whinis

New Member
Prime Account
Messages
29
Reaction score
0
Points
0
Yes I unsuspended myself however I am still unsure which is causing the problems considering my low amount of visitors and which script could cause such a high cpu usage when i would only have 1 or maybe 2 people viewing said scripts as well as my having already stress tested them.
 

TonnyORG

I Code Things
Community Support
Messages
5,914
Reaction score
16
Points
38
Hello,

Maybe the plugins/mods of your script, look for the scripts that do a lot of functions ;)
 

whinis

New Member
Prime Account
Messages
29
Reaction score
0
Points
0
Well all scripts on my website are self written except the forum, and non do anything more complicated than a very short mysql query requesting 1-10 rows and the forum is not being used much.

The discouraging thing is that i use to use the latest visitors to determine who visits what however it says that no domain is eligible. So I can not see who visits what page.
 

masshuu

Head of the Geese
Community Support
Enemy of the State
Messages
2,293
Reaction score
50
Points
48
do you have any loops? loops are probably going to kill you if you don't manage them right
 

whinis

New Member
Prime Account
Messages
29
Reaction score
0
Points
0
yes 3 loops all in differnt unrelated scripts however like i said they don't run but at most 10 times and then its already been tested on my rig... infact the load time on my test rig ( single core 2.0 with 512 ram) is 1.2 seconds.
 

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
Maybe it's a php extension not enabled, or a incompatibility between PHP version. x10 uses 5.2.10.

Do you send emails or such?
 
Last edited:

masshuu

Head of the Geese
Community Support
Enemy of the State
Messages
2,293
Reaction score
50
Points
48
yes 3 loops all in differnt unrelated scripts however like i said they don't run but at most 10 times and then its already been tested on my rig... infact the load time on my test rig ( single core 2.0 with 512 ram) is 1.2 seconds.

1.2 seconds for a php script is a fairly long time

as far as i can tell, the thing that hits a webserver the most is loops.

what do these loops do? do they illiterate 5 times? 10 times, 1000 times?
 

whinis

New Member
Prime Account
Messages
29
Reaction score
0
Points
0
well I reasoned that it took so long because its a single core 2.0 with 512 ram running a web server email server and mysql. There are not very many things you do fast on that computer.

however the loops simple run until all info is written in html. while there is about 7 lines of html to run and input information into and 1 of them involves a time counter to determine posting date but it shouldn't bog it down that much since my mysql query is already limited to 10.
 

jtwhite

Community Advocate
Community Support
Messages
1,381
Reaction score
30
Points
0
Is it processing large amounts of data? The data size can also contribute to the load. A loop that ads 1 + 1 a hundred times will use less CPU than a loop searching through a few paragraphs of text.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Without seeing the code in question, anything we say is just guesswork.
 

whinis

New Member
Prime Account
Messages
29
Reaction score
0
Points
0
while I know this is not the coding section here is the loop

PHP:
while ($row = mysql_fetch_assoc($result)) {
$message=$row['message'];
$date=$row['date'];
$time=$row['time'];
$Number=$row['number'];
$csql="SELECT post FROM comment WHERE post=$Number";
$cresult = mysql_query($csql);
if (!$cresult) {
    echo "Could not successfully run query ($sql) from DB: " . mysql_error();
    exit;
}
$Cnum = mysql_num_rows($cresult);
$t=ago($time);
echo "<p align='left' style='font-size:9px'>this blog was posted on $date, $t</p>
<p align='justify'>$message</p>
<p align='right'><a href='comment.php?post=$Number'>$Cnum Comments</a></p>
<hr>";
}

and the mysql that it pulls from
PHP:
$sql = "SELECT message, date, time, number  FROM blog ORDER BY number DESC $limit";
 
Last edited:
Status
Not open for further replies.
Top