I was on the IRC channel yesterday trying to figure out why habari was
causing the processes on my apache server to reach ~80Mb and due to some
less than perfect settings the whole server to freeze up under relatively
little load.  Although several people tried to help and offered several
useful comments we weren't able to identify the problem.  I've taken another
look today and have finally been able to figure out what the problem is.

I had initially thought it was every page causing the problem but with a
considerable amount of trial and error I stumbled onto the discovery that it
was only one blog post and any page that referenced it.  Fetching most pages
used ~6Mb of memory as measured by *memory_get_peak_usage *but this one blog
post would use ~63Mb.  It would also take considerably longer to load than
other pages (>10s).  Using xdebug and kcachegrind I noticed that most of the
time was spent getting and setting Comment objects.

Looking at the comments in the database I realised that a) I had a lot of
spam comments that needed deleting and b) the vast majority were on this one
post.  Deleting the spam comments seems to have fixed the problem.  Memory
usage drops back down to ~6Mb and requesting the page is faster as well.

Hopefully this will be useful to someone else in the future.

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/habari-dev

Reply via email to