Support » Plugin: Disqus Comment System » slow down website performance

  • My website slow down in every 3 or 4 days.
    when my website slow down it shows the maximum thread of sql queries.
    and below is the small piece of one update query

    UPDATE s8u2p0u_options SET option_value = ‘a:12:{i:1429712875;a:1:{s:14:\”dsq_sync_forum\”;a:1:{s:32:\”40cd750bba9870f18aada2478b24840a\”;a:2:{s:8:\”schedule\”;b:0;s:4:\”args\”;a:0:{}}}}

    This query runs and use the maximum memory and it cause my website performance
    so please help me regarding this issue.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hint: Take a look at the output of:
    SELECT * FROM wp_options WHERE option_name = 'cron'\G

    If you’re issue is anything like ours, you probably have tens of thousands of dsq_sync_forum cron jobs schedule – one triggered every page hit, 5 minutes from when it was hit. At some point, you won’t be able to clear the jobs quickly enough, and your website will be brought to its knees.

    Maybe try this patch (which I’m currently in the process of testing):

    Index: disqus.php
    --- disqus.php	(revision 1214695)
    +++ disqus.php	(working copy)
    @@ -511,7 +511,9 @@
                     } else {
                         $ts = time() + 300;
    -                    wp_schedule_single_event($ts, 'dsq_sync_forum');
    +                    if (!wp_next_scheduled('dsq_sync_forum')) {
    +                        wp_schedule_event($ts, 'hourly', 'dsq_sync_forum');
    +                    }
                         die('// sync scheduled');

    That should slow down the Disqus syncs to one per hour max, which I imagine is more than enough.

    Having this issue as well, How did the patch work out?

    The Disqus devs wouldn’t accept a PR because they don’t want everyone running low traffic websites to have their blog hit the Disqus servers every hour if they didn’t even receive any hits. That’s a fair point, but it sucks for high-traffic websites that are getting destroyed in the meantime (and probably hurting the Disqus servers more overall anyway). I’m quite amazed they haven’t addressed the issue themselves by now, given they now know their plugin is causing big issues for people using it.

    Having said that, I don’t think the above approach was completely reliable. I think this may have been related to a conflict somewhere with W3 Total Cache, but didn’t spend more time than necessary investigating.

    In the end, I commented out the entire sync_comments case statement section from disqus.php, and modified scripts/import-comments.php to write to syslog instead of stdout. I then call that import-comments.php script directly via a cron job on one (and only one) of our app servers. I also had to comment out the unused DummyWP_Object_Cache class from lib/wp-cli.php for this to work properly. This approach seems to be working quite well.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘slow down website performance’ is closed to new replies.