[Akara - Feature #1221] (New) Profiler instrumentation for Akara modules

0 views
Skip to first unread message

red...@foundry.zepheira.com

unread,
Jan 13, 2011, 11:58:00 AM1/13/11
to
Issue #1221 has been reported by Uche Ogbuji.

----------------------------------------
Feature #1221: Profiler instrumentation for Akara modules
http://foundry.zepheira.com/issues/1221

Author: Uche Ogbuji
Status: New
Priority: Normal
Assigned to: Andrew Dalke
Category:
Target version:


We need to be able to invoke Akara in a mode where it gathers profiler stats for module invocation. For example, perhaps a config variable would trigger wrapping the call to the module with cProfile, with stats gathered and pushed somewhere on disk for later analysis.

Possibly we could have something like the following:

* Request comes in to master process; master invokes worker
* Worker thread wraps handler function invocation in cProfile.run
* Profiler raw stats are captured and saved as a file in the akara directory root somewhere (i.e. alongside caches and logs), maybe encoded as $PID-$REQUESTIP-$TIMESTAMP.bin
* The developer can then go back and correlate the request he's looking to profile against the filename and run python -m pstats on the relevant file to browse the stats

Clearly in this mode everything would be would slowed down considerably, possibly resulting in client-side timeouts, but this feature is strictly for developers, and that's just for the developer to manage.


--
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://foundry.zepheira.com/my/account

red...@foundry.zepheira.com

unread,
Jan 14, 2011, 1:07:43 AM1/14/11
to
Issue #1221 has been updated by Andrew Dalke.


I'm going to aim for the solution here, which is to have some sort of configuration setting and server restart in order to enable/disable profiling.

Other options are to modify the specific routine to profile or to use some sort of web services interface to change profiling mode on a running server.

Wasn't sure if the last has been considered, so I'm bringing it up here.


----------------------------------------
Feature #1221: Profiler instrumentation for Akara modules
http://foundry.zepheira.com/issues/1221

Author: Uche Ogbuji
Status: New
Priority: Normal
Assigned to: Andrew Dalke
Category:
Target version:


Coped from original ticket (now closed) at http://trac.xml3k.org/ticket/66

red...@foundry.zepheira.com

unread,
Jan 16, 2011, 8:57:06 PM1/16/11
to
Issue #1221 has been updated by Mark Baker.


I hadn't considered that Andrew; I would have been happy with requiring a restart. But if the complexity and overhead of enabling it at runtime is reasonably low, I could see it being useful; for example, being able to profile an instance that is in some hard-to-reproduce problem state (which we've run into before).


----------------------------------------
Feature #1221: Profiler instrumentation for Akara modules
http://foundry.zepheira.com/issues/1221

Author: Uche Ogbuji
Status: New
Priority: Normal
Assigned to: Andrew Dalke
Category:
Target version:

Coped from original ticket (now closed) at http://trac.xml3k.org/ticket/66

We need to be able to invoke Akara in a mode where it gathers profiler stats for module invocation. For example, perhaps a config variable would trigger wrapping the call to the module with cProfile, with stats gathered and pushed somewhere on disk for later analysis.

Reply all
Reply to author
Forward
0 new messages