[mod_python] need help solving some performance issues

Colin Bean ccbean at gmail.com
Thu Apr 10 15:10:39 EDT 2008


On Thu, Apr 10, 2008 at 11:53 AM, Culley Harrelson <harrelson at gmail.com> wrote:
> On Thu, 10 Apr 2008, Colin Bean wrote:
>
>  >
>  > Have you profiled your code at all?  Might help to track down problem areas...
>  >
>
>  No I haven't.  Is there a way to profile it in the context of
>  mod_python?  A lot of what is happening is manipulating clearsilver datasets.
>

Here's some information on profiling with Publisher:
http://www.modpython.org/pipermail/mod_python/2007-September/024237.html

Basically, whatever handler you're using, you can write a
ProfileHandler which wraps your original handler in some profiling
code.  I did this a while ago with the built in profile module and a
custom handler.  Hopefully you have a development server where you can
set this up, and perhaps hammer it with some load testing tools.

>  >
>  >
>  > You might also want to look at caching solutions, especially if you
>  > have plenty of RAM :)  You could probably roll your own with Memcached
>  > without too much trouble, and this could potentially ease the load on
>  > the CPU quite a bit.
>
>  The database load doesn't seem to be really a big problem.  There are hundred
>  of thousands of pages, each translated into 6 languages.  I tinkered around
>  with mod_cache a bit but it couldn't handle it.
>

Was thinking more of caching your rendered templates (as whole pages
or fragments), if you can make this workable with user permissions,
etc.  That would save your server from rendering them from scratch on
every page hit.  This is especially good if your content is something
that doesn't change often (like flash cards :) ).

Colin


More information about the Mod_python mailing list