You are here: Re: PHP Optimization question « PHP Programming Language « IT news, forums, messages
Re: PHP Optimization question

Posted by IanReardon on 01/13/08 16:34

My sever is a dual core intel box, dedicated running CentOS and 1 gig
of ram. No other websites are hosted on this box

I have MySQL query cache of about 100M, which is being used quite a
bit when I check the cache hits

The php code is just HTML with inline php statements like, probably
about 75-100 lines
(this is just an example, my page uses CSS not tables)
<table>
<tr>
<td><? echo $someVar; ?></td>
</tr>
</table>


To check the execution time I use a fucntion as follows

function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}

I record the start time, and end time, then print the delta

Any other suggestions would be appreciated, thank you!

On Jan 13, 9:13 am, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> IanRear...@gmail.com wrote:
> > I'm trying to optimize a php project of mine and I'm running into some
> > problems.
>
> > Overall the page takes about .4-.5 seconds to render (just the code,
> > i'm recording the time at start and finish of execution) on a my dual
> > core server with nothing else running (other than httpd and mysqld)
>
> > I've optimized my queries, total mysql query time is about .1 to .12
> > seconds total.
>
> > For some reason the part of my php that takes the longest to execute
> > is a rather large section of html code with some <? echo $someVar; ?>
> > sprinkled in. There is no logic or functional calls, yet this block
> > of code (maybe 50 lines of HTML, takes around .3 seconds to execute.
>
> > Can anyone recomend ways to find out where my php code is executing
> > slow?
>
> > Thank you
>
> How do you know it's taking that long for the PHP to execute? I
> wouldn't expect it to take very long to process the HTML code. You
> didn't show us what echo statements you had, but I wouldn't expect a few
> of those to take long, either.
>
> There can be a lot of other things involved. For instance, during this
> code, you may have filled the PHP buffers. This would have flushed the
> buffers to your web server.
>
> Now, flushing the PHP buffers to the web server could easily have filled
> the web servers buffer. So now the web server has to flush its buffers
> to the browser.
>
> All of this takes time, also.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация