|
Posted by Gilles Ganault on 01/07/08 06:59
On Sun, 06 Jan 2008 20:47:11 -0500, Jerry Stuckle
<jstucklex@attglobal.net> wrote:
>The training E is not in the number - that's how very small floating
>point numbers are displayed.
I'll look at how to format the output of Microtime() so it's displayed
as seconds instead:
======
$start_time = microtime(true);
$end_time = microtime(true);
$total_time = $end_time - $start_time;
print "Using microtime() as-is : $total_time<p>";
$starttimer = time()+microtime();
$stoptimer = time()+microtime();
$timer = round($stoptimer-$starttimer,4);
echo "Using Time + Microtime() : $timer";
======
Using microtime() as-is : 2.6941299438477E-5
Using Time + Microtime() : 0.2018
======
> The real question would be if this is normal, a peak - or
> maybe a lull in the traffic. In the last case it could be a problem.
It's peak time. He had about 400 users logged on, with an unknown
number of guests lurking, which is the highest number he ever had.
>And yes, the CPU usage is high, but not necessarily that high.
The reason I thought it was a problem, is that this article on "top"
says that "load average" should not be much higher than 4, ie. 4 times
the amount of processes per processor (it's a single-CPU host):
"The higher the number for load average, the more likely your system
is starting to suffer under an excessive load. As the saying goes,
your mileage may vary, but I tend to think of anything under four as
acceptable. Any higher and it starts feeling slow. I've seen systems
running around 15 to 20 and let me tell you, it's ugly."
http://www.linuxjournal.com/article/5309
>I'm really wondering if your host is trying to put too many people on
>your server. Monitoring the results of top over a period of time will
>help show you.
If it helps, it's very responsive with about 200 users logged on, but
it crawls to a halt with 400.
Generally speaking, and considering the number of web apps being
written these days, especially in LAMP, I'm surprised Google didn't
return an article on what to do to investigate a slow web application.
Thanks.
Navigation:
[Reply to this message]
|