WordPress.org

Forums

WordPress Popular Posts
Host disabled plugin due to excessive CPU usage and sub queries (8 posts)

  1. mishaintheair
    Member
    Posted 1 year ago #

    Hi, rec'd this email from my hosting provider because they disabled the plugin because it was crashing the site repeatedly.

    Am I doing something wrong? Is there a possible fix? This plugin was amazing and working really well, but seems to be the source of my issues the last few weeks.

    Customer has a database called (fis1118909210684) which is causing excessive CPU usage on the server. This excessive CPU usage is due to a plugin on the WordPress called "wordpress-popular-posts." This plugin runs subqueries which cause a significant amount of load on the server. An example of the query can be found below. Customer needs to review this plugin and determine if it is absolutely essential. It is suggested the customer remove this plugin if not needed. If the customer does need this plugin, the customer must find a way to optimize the use of this plugin so it is not issuing such expensive transactions. Customer may do this on their own or they may wish to hire a professional to do this for them. To immediately address the impact this plugin was causing the server, we have changed the permissions on this plugin to 000 at the location (html/wp-content/plugins/wordpress-popular-posts). Customer may alter the permissions of this plugin at anytime, but is likely to be netvio'ed again should they alter the perms before addressing the issue.

    Please contact the customer and advise a review of this plugin to ensure that such costly transactions are avoided.

    Problematic Query:
    SELECT p.ID AS 'id' , p.post_title AS 'title' , p.post_date AS 'date' , p.post_author AS 'uid' , v.pageviews AS 'pageviews' FROM (SELECT id , SUM(pageviews) AS pageviews , MAX(day) AS day FROM wp_popularpostsdatacache WHERE day > DATE_SUB('2013-09-16 19:36:03' , INTERVAL 1 WEEK) GROUP BY id ORDER BY pageviews DESC , day DESC) v LEFT JOIN wp_posts p ON v.id = p.ID WHERE p.post_type IN('post' , 'page') AND p.ID NOT IN ( SELECT object_id FROM wp_term_relationships AS r JOIN wp_term_taxonomy AS x ON x.term_taxonomy_id = r.term_taxonomy_id JOIN wp_terms AS t ON t.term_id = x.term_id WHERE x.taxonomy = 'category' AND t.term_id IN(6337 , 8310 ) ) AND p.post_password = '' AND p.post_status = 'publish' LIMIT 10

    http://wordpress.org/plugins/wordpress-popular-posts/

  2. Hector Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    Hi there,

    Am I doing something wrong? Is there a possible fix? This plugin was amazing and working really well, but seems to be the source of my issues the last few weeks.

    No, not your fault. This plugin is a complex one and uses a lot of resources, as your host pointed out. The more features you activate (category filtering, for example), the more data WPP has to retrieve to build the list. On sites with low / medium activity the performance hit is barely noticeable, but on high-traffic sites WPP can cause issues. I've been working on a newer version that uses query-caching which should lower significantly the burden on the database - but it's still far from ready and needs a lot of testing.

    So, unfortunately, at the moment you only got two choices: disable the category filtering, which will reduce the impact on your database; or disable the plugin until the new version is ready for release, which as I said might take some more time (would you like to help me test it?).

  3. mishaintheair
    Member
    Posted 1 year ago #

    Ahh understandable. I will try just 1 tab instead of 6 that we had.

    What would "testing" involve?

  4. zekkie
    Member
    Posted 1 year ago #

    OR...upgrade your hosting package..

  5. Hector Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    @mishaintheair version 3.0.0 seems to be stable as of now and most features are ready. Once I'm done with a couple of things I can send you the beta version so you can try it out - the caching feature I told you about should improve things a lot.

  6. hengxi
    Member
    Posted 1 year ago #

    Same problem for me.

    This plugin is a must but have desactivated it for the same reason.

    Can you send me the 3 version.

    Thank you.

  7. Hector Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    You can get it here.

    If you're going to test it, I strongly advice you guys to make a complete backup first (including your database tables) before installing this version - v3 includes couple of changes on plugin's database tables and you won't be able to go back to older versions of the WPP plugin without a database backup.

    Also, be warned (as I said before) that v3 is still a work in progress. Stuff can break - hopefully not.

  8. pisaacs
    Member
    Posted 1 year ago #

    I'm also seeing very high CPU rate using the plug in. My server has actually crashed a couple of times under heavy load. Any idea when the new version of the plugin will be available?

    Also do you have any tips in the mean time that could help less the load a bit?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WordPress Popular Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic