I manage a very popular site where people can comment on a page displaying a web cam of an owl’s nest. It has become an important social network and this one page receives many comments every day: 4600 for January alone and over 149000 for the life of this page. http://starrranch.org/blog/barn-owl/
It appears that when WordPress loads a page, it loads *all* of the associated comments into memory, regardless of whether they are displayed in the active view, so whenever someone visits a page, or refreshes it to see what their friends have posted, the CPU takes a huge hit.
I regularly have to go into the database and move older comments onto “archive” pages to prevent the CPU from getting hammered and threats of shutdown from the hosting provider. Caching plugins like WP Total cache help a little, but if I enable the more hard-core settings like browser caching we get complaints because people don’t see their comments right away.
The commenting feature is important to this site, as public engagement is a major factor for the surrounding community as well as for fundraising, so they do not wish to limit the comment functionality.
It seems to me that this architecture is flawed. I would like to find a way to load only the comments that are being viewed, and not to load the other comments associated with the page until the pagination navigation is clicked. The theme is a simple child theme of twentyeleven, so I don’t think this is a theme issue, and I’ve been through plugin triage several times to rule out a plugin issue. These CPU problems can always be resolved by reducing the comment footprint on the page. Last year I looked into plugins to change the way comments are loaded with no success. While a couple of ajax plugins looked promising I didn’t find any that worked well on the site.
I recognize that most WordPress sites do not generate so many comments per page, so this functionality is acceptable under typical conditions. But since a goal of having a web site is to reach a wide audience, the fact that commenting does not scale up well is problematic.
I have floated the idea of switching to a chat-based interaction but I’m not convinced that would be any less resource intensive. Plus, any change to the way the site works is generally not well received and requires re-training of all of the users.
(@webmystery)
12 years, 4 months ago
I manage a very popular site where people can comment on a page displaying a web cam of an owl’s nest. It has become an important social network and this one page receives many comments every day: 4600 for January alone and over 149000 for the life of this page. http://starrranch.org/blog/barn-owl/
It appears that when WordPress loads a page, it loads *all* of the associated comments into memory, regardless of whether they are displayed in the active view, so whenever someone visits a page, or refreshes it to see what their friends have posted, the CPU takes a huge hit.
I regularly have to go into the database and move older comments onto “archive” pages to prevent the CPU from getting hammered and threats of shutdown from the hosting provider. Caching plugins like WP Total cache help a little, but if I enable the more hard-core settings like browser caching we get complaints because people don’t see their comments right away.
The commenting feature is important to this site, as public engagement is a major factor for the surrounding community as well as for fundraising, so they do not wish to limit the comment functionality.
It seems to me that this architecture is flawed. I would like to find a way to load only the comments that are being viewed, and not to load the other comments associated with the page until the pagination navigation is clicked. The theme is a simple child theme of twentyeleven, so I don’t think this is a theme issue, and I’ve been through plugin triage several times to rule out a plugin issue. These CPU problems can always be resolved by reducing the comment footprint on the page. Last year I looked into plugins to change the way comments are loaded with no success. While a couple of ajax plugins looked promising I didn’t find any that worked well on the site.
I recognize that most WordPress sites do not generate so many comments per page, so this functionality is acceptable under typical conditions. But since a goal of having a web site is to reach a wide audience, the fact that commenting does not scale up well is problematic.
I have floated the idea of switching to a chat-based interaction but I’m not convinced that would be any less resource intensive. Plus, any change to the way the site works is generally not well received and requires re-training of all of the users.
I found a couple other posters who identified this problem, but no real solutions offered:
http://ww.wp.xz.cn/support/topic/too-much-cpu-usage-comments
http://ww.wp.xz.cn/support/topic/the-effect-of-spam-comments-on-hosting-resource-usage-cpu
I welcome any feedback or suggestions.