[BangPypers] log and figure out what bits are slow and optimize them.
steve at lonetwin.net
Tue Feb 14 10:00:16 CET 2012
If it's a production website you might want to look at NewRelic. We started
using it a while back and it has been mighty helpful:
On 02/12/2012 08:09 PM, Anand Chitipothu wrote:
> 2012/2/12 Saju M <sajuptpm at gmail.com>:
>> I wrote a decorator using cProfile.
>> Issue is log-file getting messed up with logs of unwanted method
>> calls(library calls).
>> I tried with prof.getstats() and prof.print_stats(), prof.getstats() force
>> to code extra loops to get infos.
>> I am also planning to enable/disable this logging using DEBUG flag.
>> Have any suggestions to improve this code ??? or any other-way ??
> Since you are doing this in a webapp, you should be able to write a
> WSGI middleware that enables the profiler if profile=true is passed as
> query parameter.
> I found this technique very useful to optimize webapps. Here is an example:
> web.py has a nice profile middleware, it shouldn't be too hard to reuse it.
> BangPypers mailing list
> BangPypers at python.org
random spiel: http://lonetwin.net/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
More information about the BangPypers