NYCPHP Meetup

NYPHP.org

[nycphp-talk] speed problems in OO PHP4

Mark Armendariz enolists at gmail.com
Tue Feb 20 22:46:29 EST 2007


How is the script continually processing?  Do you mean that the page still
seems to be loading in a browser or the server processes are still going?

If it's continually loading in the browser, Jiju is on.  I ran into this
quite a bit with a faulty mod-rewrite which was actually loading a copy of
the site for every image, css and javascript file call.  Even when I fixed
that it ended up 
doing the same for any 404's.  That was an Enormous hit on the server (large
project with quite a few heavy oo classes).

If it's on the server and you're using apache, my first suggestion is to run
php in cgi mode if at all possible.  Switching from mod to cgi made it
easier to tell 'who' was hogging everything, since php runs separately (can
monitor the php executable to see when it stops)

Also, look into xdebug's automated profiling, which is incredibly helpful -
think firebug for your server.  Use KCacheGrind (linux only) or
WinCacheGrind (Win32) to process xdebug's logs.  That'll tell you Exactly
where all the time is going - which functions, which classes, etc.

Mark Armendariz

> -----Original Message-----
> From: talk-bounces at lists.nyphp.org 
> [mailto:talk-bounces at lists.nyphp.org] On Behalf Of Robyn Overstreet
> Sent: Tuesday, February 20, 2007 7:33 PM
> To: NYPHP Talk
> Subject: [nycphp-talk] speed problems in OO PHP4
> 
> I'm not sure where to start with this one, because I'm so 
> stumped. I'm working on an application which uses many 
> different class files (a database class, an abstract object 
> class, and several classes that inherit from it, etc) and 
> it's running really, really slowly. I've timed many parts of 
> the code, but still can't isolate the hangups. It doesn't 
> seem to be the database queries themselves. I thought it 
> might be the amount of processing it takes to include all the 
> external class files. I tried using PEAR Cache_Lite, but 
> there seemed to be no significant speed increase. One strange 
> thing I notice is that the script appears to continue 
> processing after all elements on the page are correctly displayed.
> 
> Any ideas or strategies for optimization/debugging?
> 
> Thanks-
> Robyn
> _______________________________________________
> New York PHP Community Talk Mailing List 
> http://lists.nyphp.org/mailman/listinfo/talk
> 
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
> 
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
> 




More information about the talk mailing list