[wp-hackers] Paged Comments and Memory Usage
jer at simianuprising.com
Tue Feb 14 13:58:25 UTC 2012
I wouldn't be surprised if all the comments are loaded in memory, it makes
sense from a lot of angles. Handling all the relationships between comments
in a 10-deep hierarchy at the DB level would just move your performance
problem from Apache into MySQL if you had that many comments to work with.
Also I imagine loading them all and sorting it out in PHP is not a problem
99% of the time for WP sites.
64MB isn't THAT bad in terms of a memory limit, some WP installs are just
big and heavy (mine needs more than 64MB to run and I have to bump it up
higher if I want an export to finish).
FWIW 8000 comments on one post is also nuts, and 10-deep replies seems
senseless to me. Ideally WP would handle it gracefully anyway, but how can
that be a good experience for someone who wants to comment or read the
comments already there? 8000 posts is enough to fill up an entire forum
worth of threads, where there would be all kinds of useful navigation and
UI for the task of handling such a complex discussion.
PEOPLE: Limit your thread-depth to 5 and if one post gets more than a few
hundred comments just close the discussion! The likelihood that you're
getting productive comments after the 500th is very low, as is the
likelihood that anyone is reading them all. Consider giving your community
a forum or a stackexchange instead.
Jeremy Clarke • jeremyclarke.org
Code and Design • globalvoicesonline.org
More information about the wp-hackers