Re: Profiling Catalyst
by perrin (Chancellor) on Jul 21, 2007 at 19:16 UTC
|
| [reply] |
Re: Profiling Catalyst
by CountZero (Bishop) on Jul 21, 2007 at 21:25 UTC
|
If you cannot find an answer here, perhaps the Catalyst Mailinglist might be a good place to ask.
CountZero A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
| [reply] |
Re: Profiling Catalyst
by jplindstrom (Monsignor) on Jul 21, 2007 at 23:38 UTC
|
You could start the stand-alone server ./script/YOURAPP_server.pl with the profiler loaded.
This would accept one request at a time though, but that sounds perfectly fine for what you want to use it for.
/J
| [reply] |
|
... but that sounds perfectly fine for what you want to use it for.
Indeed, it is. But how to do so?
| [reply] |
Re: Profiling Catalyst
by bennymack (Pilgrim) on Jul 23, 2007 at 01:00 UTC
|
What have you tried so far?
Devel::DProf should work just fine. I prefer Devel::SmallProf myself but they should both do the job.
First, start your Catalyst app with "perl -d:DProf script/myapp_server.pl" then hit it repetitively with something like ab '/usr/sbin/ab -n 1000 "http://127.0.0.1:3000/"'. Then you'll just need to kill the development server with CTRL+C. This should at the very least identify the hotspots on the slow pages you're concerned with.
| [reply] |
|
I've just tried that and it segfaults (Win32, ActivePerl 5.8.8)
| [reply] [d/l] |
|
| [reply] |
Re: Profiling Catalyst
by mojotoad (Monsignor) on Jul 22, 2007 at 04:04 UTC
|
Hi holli,
Does your larger application hammer on the system much via overwhelming db locking (table? row?), IO, threading, forking, etc? Just curious, as these things, if they are an issue, might not show up in the profiling.
Cheers,
Matt
| [reply] |
Re: Profiling Catalyst
by andreas1234567 (Vicar) on Jul 22, 2007 at 18:12 UTC
|
You may find tools like sar and vmstat useful if you are on a linux/unix platform.
| [reply] |
Re: Profiling Catalyst
by mattr (Curate) on Jul 24, 2007 at 06:12 UTC
|
It may not be obvious if you are on Win32 but you are already using the built-in profiling per subroutine, correct? That is, if you open a command line shell in linux and run the scripts/xx_server.pl http daemon it will for each request tell you precisely how much time each routine/phase takes. At least it does when I run from a linux shell, with Debug on. I didn't catch exactly what is segfaulting for you but you might try to run the http daemon from a cygwin shell for instance. I think the same output (with Debug on) is shown in the apache error log, at least it is with my FastCGI server.
Also here is a post about using Time::HiRes with Debug in Catalyst for some simple profiling, it lets you start and stop a timer. This module (which ought to be added to CPAN perhaps) might do what you want.
I recommend joining the Catalyst ML. | [reply] |