Server Load skyrocketing and I always see the same processes taking up all the resources

Hello WPMUDevers!

I<m having this problem now it's been almost 2 weeks, and it's not good. Every day, multiple times a day the server goes down because of the load going overboard. Now I have a very few plugins that may be causing this. I have a cron job that keeps swallowing all the resources! Don't know which one it is, but deacivated almost everything that has automated things happening. My next move is to disable Defender (as it has caused server load issues in the past).

The second file that keeps popping up is admin-ajax.php. I have it showing up in the processes almost ALL THE TIME!

I'm at a loss as to why it keeps showing up. I heard it's for trackbacks and pings. I deactivated it as recommended in Defender (I believe). I really don't know how to resolve this issue and it has been taking hours of my day everyday for the past 2 weeks.

Your help is truly appreciated.

Best regards,

Paul

  • Michael Bissett

    Hey Paul, Michael here! :slight_smile:

    Starting from this:

    Every day, multiple times a day the server goes down because of the load going overboard

    You said it started 2 weeks ago, you make a particular change around then? Like:
    - Installing a new plugin
    - Updating an existing plugin

    Regarding these two:

    I have a cron job that keeps swallowing all the resources!

    The second file that keeps popping up is admin-ajax.php. I have it showing up in the processes almost ALL THE TIME!

    admin-ajax.php gets used for quite a few things (more than just comments & pingbacks), and is a pretty important part of WordPress.

    On that cron job swallowing up resources, are you seeing a particular pattern to the downtime? Like it's happening every 3 hours, or every 4 hours?

    And what kind of resources are we talking here? CPU, or memory, or both?

    Is the WP_MEMORY_LIMIT define set to at least 256M in your site's wp-config.php, like this:

    define( 'WP_MEMORY_LIMIT', '256M' );

    Please advise,
    Michael

  • Paul

    Hello Michael,

    In regards to updating or installing a new plugin, I can't really tell you since I get about 10+ updates per week. I know that since I installed Defender, whenever I try and access Defender everything slows down and it overloads. Now it was improved with a recent update, but still feel it uses too much resources (I'm on a vps). I uninstalled Defender, it got better, but still one issue. the admin-ajax.php file keeps running.

    I haven't seen that cron job again since uninstalling Defender. I guess there are a few scans running at the same time. It was scanning all my websites, doing the google check every 6, and a whole bunch of stuff.

    Resources are CPU. WP memory limit is at 512M.

    Thanks,

    Paul

  • Paul

    I also found this in my error log. The only other scron job that would happen is the SNAP auto poster. But I had stopped it on the only website that was using it, but I still see this error in the log. Not sure if it is from SNAP, but I saw the word rePoster etc.... which I guess could be it? How can we tell? The first few words are french for Database error.

    [12-Apr-2016 16:43:52 UTC] Erreur de la base de données WordPress Column 'extInfo' cannot be null pour la requête INSERT INTO zal_75_nxs_log (date, act, msg, extInfo, type, nt) VALUES ('2016-04-12 12:43:52', 'RE-Poster', 'Skipped - Excluded Day - 2', NULL, 'S', '<span style=\"color:#800000\">Facebook</span> - Touché Studio Page') faite par do_action_ref_array, call_user_func_array, nxs_do_post_from_query, nxs_rePoster, nxs_addToLogN

    Thanks,

    Paul

  • Paul

    [12-Apr-2016 16:43:52 UTC] Erreur de la base de données WordPress Column 'extInfo' cannot be null pour la requête INSERT INTOzal_75_nxs_log(date,act,msg,extInfo,type,nt`) VALUES ('2016-04-12 12:43:52', 'RE-Poster', 'Skipped - Excluded Day - 2', NULL, 'S', '<span style=\"color:#800000\">Facebook</span> - Touché Studio Page') faite par do_action_ref_array, call_user_func_array, nxs_do_post_from_query, nxs_rePoster, nxs_addToLogN
    `

    I guess that would be the right way of showing this?

  • Paul

    Hello,

    Ok so P3 profiler only works on individual websites and won't scan the whole network. So I decided to check the main site (which really just has activated plugins and a theme for automatic updates, otherwise it's manual). I will also scan 2 other sites which I think may have an issue.

    Main site stats (including screenshot which does not look good!)

    WordPress Plugin Profile Report
    ===========================================
    Report date: April 21, 2016
    Theme name: X
    Pages browsed: 6
    Avg. load time: 4.5393 sec
    Number of plugins: 48
    Plugin impact: 85.89% of load time
    Avg. plugin time: 3.8987 sec
    Avg. core time: 0.2734 sec
    Avg. theme time: 0.0963 sec
    Avg. mem usage: 231.54 MB
    Avg. ticks: 231,922
    Avg. db queries : 472.67
    Margin of error : 0.2709 sec

    Plugin list:
    ===========================================
    P3 (Plugin Performance Profiler) - 0.0193 sec - 0.49%
    Admin Menu Editor Pro - 0.1504 sec - 3.86%
    Avatars For Multisite - 0.0147 sec - 0.38%
    New Blog Templates - 0.0193 sec - 0.50%
    Cloner - 0.0138 sec - 0.35%
    Content Monitor - 0.0045 sec - 0.12%
    Domain Mapping - 0.3192 sec - 8.19%
    Easy Theme And Plugin Upgrades - 0.0027 sec - 0.07%
    Google Analytics + - 0.0189 sec - 0.48%
    Support System - 0.0422 sec - 1.08%
    Multi-Domains for Multisite - 0.0068 sec - 0.17%
    Multisite Enhancements - 0.1183 sec - 3.03%
    Multisite Theme Manager - 0.0094 sec - 0.24%
    NextScripts: SNAP Pro Upgrade Helper - 0.0216 sec - 0.55%
    Pretty Plugins - 0.0093 sec - 0.24%
    Remove WP Dashboard Widgets - 0.0017 sec - 0.04%
    Optimize Database after Deleting Revisions - 0.2728 sec - 7.00%
    Multisite Privacy - 0.0068 sec - 0.18%
    Social Networks Auto Poster Facebook Twitter G - 0.1526 sec - 3.91%
    TinyMCE Advanced - 0.0007 sec - 0.02%
    Ultimate Branding - 0.5826 sec - 14.94%
    User Activation Keys - 0.0023 sec - 0.06%
    User Activity - 0.0039 sec - 0.10%
    User Role Editor - 0.0199 sec - 0.51%
    User Switching - 0.0027 sec - 0.07%
    Wordfence Security - 0.3318 sec - 8.51%
    Wp Smush Pro - 0.0326 sec - 0.84%
    Wp Super Cache - 0.0068 sec - 0.17%
    Wp Toolbar Editor - 0.0321 sec - 0.82%
    SmartCrawl - 0.0283 sec - 0.73%
    Wpmudev Updates - 0.0260 sec - 0.67%
    WPMU DEV Videos - 0.0052 sec - 0.13%
    Cornerstone - 0.2780 sec - 7.13%
    Ninja Forms Conditionals - 0.0099 sec - 0.25%
    Ninja Forms Multi Part - 0.0099 sec - 0.25%
    Ninja Forms Save Progress - 0.0152 sec - 0.39%
    Ninja Forms - Layout & Styles - 0.0216 sec - 0.55%
    Ninja Forms Uploads - 0.0355 sec - 0.91%
    Ninja Forms - 0.1536 sec - 3.94%
    Sitepress Multilingual Cms - 0.6955 sec - 17.84%
    Woocommerce Multilingual - 0.0885 sec - 2.27%
    WooCommerce Ninja Forms Product Add-Ons - 0.0064 sec - 0.16%
    WooCommerce - 0.1675 sec - 4.30%
    Wpml Media - 0.0119 sec - 0.30%
    Wpml Sticky Links - 0.0057 sec - 0.15%
    Wpml String Translation - 0.0718 sec - 1.84%
    Wpml Translation Management - 0.0480 sec - 1.23%
    Empty - 0.0007 sec - 0.02%

    Doing the other 2 and reporting them back here.

  • Jude

    Hi again Paul

    Can you post the results of the queries test here ? Also going by the results I see here you need a good caching system in place ASAP. 473 queries and 3.8 secs not accounting for latency are simply not acceptable today.

    You need to seriously go through the plugin list and weed out any that are not absolutely essential to the site.

    Jude

    PS: Also here is a tip on getting the best support here. Is usually best to keep replies in a single thread, append / edit if needed. We use a feed based system here and each subsequent reply pushes the ticket back to the end of the queue. It does not affect members most of the time, in some cases when there is a spike it can slow down responses.

  • Paul

    Thanks for the tip Jude! :wink:

    Unfortunately I cannot get the results because I completely deactivated the plugin. The whole network crashes when I reactivate it. But I think I figured it all out. I am no longer going to be working on a Multisite setup. Instead, I will be setting up different cPanels for the clients, and each will have his own installation, database etc... it is SO MUCH easier for support, troubleshooting etc....

    What do you think? I will be using a service such as MainWP (or the likes).

    Paul

  • Michael Bissett

    Hey Paul,

    If it's easier for you to manage your collection of sites with something like MainWP, by all means, go to it! :slight_smile:

    If the this issue with resource usage comes up again with your new setup, though, I'd advise checking out this article on diagnosing the calls to admin-ajax.php:

    https://woorkup.com/diagnose-admin-ajax-php-causing-slow-load-times-wordpress/

    Kind Regards,
    Michael

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.