Re: [PHP] Php script diagnostic app?
If you have little knowledge about C you can use sysprof on a relatively new Linux distribution and you can see on a live system where the CPU is consumed the most. [] http://www.daimi.au.dk/~sandmann/sysprof/ [] http://live.gnome.org/Sysprof With a little help of Google you can map C functions to the PHP equivalents and this way you can get a bit more of understanding about what is going on in your code. Finally, xdebug is real nice too. -William On Sun, 2007-06-17 at 13:35 -0400, MIKE YRABEDRA wrote: > > I was wondering if there was some kind of application that would process a > php script, logging any functions (or classes) it encounters along the way. > Logging times and memory use. > > I am trying to figure out what in a script slows it down so much. > > Any ideas? > > > -- > Mike Yrabedra B^)> > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Php script diagnostic app?
Thanks a lot for that post Paul. It brings up a question though. You said to never ever use that on a production server (an important disclaimer!) so I was wondering what people here used to log and simulate loads. I've used OpenSTA ( http://opensta.org/ ) and I was pleased with the results but it only works with windows. What do you guys generally use under linux? Just squid? Something else? I suppose I can just set up a windows box if I have to since OpenSTA acts as a transparent gateway but if there's a good linux solution out there for recording usage and playing it back concurrently I'd like to hear about it. With OpenSTA to create a test script it's as easy as clicking the record button to create the script and stop when you're done. Then you can go in and manually edit the script if you like and you can play it back as many times as you'd like concurrently (thereby simulating many users). Anyone know of anything like this? Thanks On 6/18/07, Paul Scott <[EMAIL PROTECTED]> wrote: On Mon, 2007-06-18 at 06:39 +0200, Paul Scott wrote: > If you would like a more detailed HOWTO, please let me know, and I will > write up something for you. http://fsiu.uwc.ac.za/index.php?module=blog&action=viewsingle&postid=gen9Srv59Nme5_9262_1182142431&userid=3897070607 --Paul All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Php script diagnostic app?
On Mon, 2007-06-18 at 06:39 +0200, Paul Scott wrote: > If you would like a more detailed HOWTO, please let me know, and I will > write up something for you. http://fsiu.uwc.ac.za/index.php?module=blog&action=viewsingle&postid=gen9Srv59Nme5_9262_1182142431&userid=3897070607 --Paul All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Php script diagnostic app?
On Sun, 2007-06-17 at 13:53 -0400, Robert Cummings wrote: > I believe there are profiling tools... probably from Zend. How big is I prefer using XDEBUG, which is totally free. You can install it from the pecl repositories: pecl install xdebug Then, you simply install it as an extension on your development machine, and execute your scripts. A really nice feature of xdebug is that not only does it give you detailed stack traces and things when stuff goes wrong, but you can also do really excellent (and graphical) profiling in combination with cachegrind (I use KCacheGrind on Ubuntu), which uses GraphViz to make very interesting graphs of what your code is doing. If you would like a more detailed HOWTO, please let me know, and I will write up something for you. --Paul All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Php script diagnostic app?
On 6/17/07, Robert Cummings <[EMAIL PROTECTED]> wrote: On Sun, 2007-06-17 at 13:35 -0400, MIKE YRABEDRA wrote: > > I was wondering if there was some kind of application that would process a > php script, logging any functions (or classes) it encounters along the way. > Logging times and memory use. > > I am trying to figure out what in a script slows it down so much. > > Any ideas? I believe there are profiling tools... probably from Zend. How big is your script? You might get away with using the microtime() function to locate slow areas of code. Generally speaking I use it to binary partition the code with echos of the current microtime() and narrow down what I want to know. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php You could check out xdebug, which is a real-time processor. I use it on two of my servers, and I'm actually pretty pleased with it. If you have a bug in your code that's multiple-functions- and several-include-files-deep, it does pretty well about telling which function (called by which function, etc.) in which file (included by which file, etc.) caused the exception. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Php script diagnostic app?
On Sun, 2007-06-17 at 13:35 -0400, MIKE YRABEDRA wrote: > > I was wondering if there was some kind of application that would process a > php script, logging any functions (or classes) it encounters along the way. > Logging times and memory use. > > I am trying to figure out what in a script slows it down so much. > > Any ideas? I believe there are profiling tools... probably from Zend. How big is your script? You might get away with using the microtime() function to locate slow areas of code. Generally speaking I use it to binary partition the code with echos of the current microtime() and narrow down what I want to know. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Php script diagnostic app?
I was wondering if there was some kind of application that would process a php script, logging any functions (or classes) it encounters along the way. Logging times and memory use. I am trying to figure out what in a script slows it down so much. Any ideas? -- Mike Yrabedra B^)> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php