• Resolved Tranny

    (@tranny)


    I run a busy high traffic and high community participation site, so MySQL has always run very high on my server. But after upgrading to v4.3 (no other change), my CPU load tripled, and it’s crippling the server, causing frequent crashes and generally degraded responsiveness.

    The site is hosted on a high end dedicated server with 4 SSD drive in hardware RAID. I spoke with my host and they assured me no changes have been done to the server, and all server side applications are up to date.

    Problems started after the update to v4.3, No other change whatsoever has been done to neither the WP installation, nor the server itself.

    My log shows high http connection count, which use abnormally high CPU never seen before:

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    17368 mysql 20 0 9348m 441m 6852 S 42.0 1.8 8:35.43 mysqld
    17941 xxxxx 20 0 1474m 54m 4748 S 27.5 0.2 0:10.38 httpd
    18526 xxxxx 20 0 1463m 43m 4680 S 27.1 0.2 0:01.42 httpd
    16675 xxxxx 20 0 1467m 46m 4284 S 24.8 0.2 0:17.30 httpd
    16830 xxxxx 20 0 1463m 42m 4300 S 23.5 0.2 0:16.92 httpd
    17777 xxxxx 20 0 1454m 34m 4780 S 23.5 0.1 0:11.56 httpd
    18358 xxxxx 20 0 1460m 40m 4760 S 23.5 0.2 0:04.49 httpd
    17881 xxxxx 20 0 1460m 40m 4716 S 23.2 0.2 0:09.88 httpd
    18220 xxxxx 20 0 1441m 21m 4768 S 23.2 0.1 0:05.12 httpd
    18472 xxxxx 20 0 1460m 40m 4748 S 23.2 0.2 0:04.12 httpd
    18331 xxxxx 20 0 1505m 84m 4700 S 22.5 0.4 0:04.02 httpd
    16892 xxxxx 20 0 1463m 43m 4316 S 22.2 0.2 0:09.67 httpd
    16872 xxxxx 20 0 1441m 20m 4240 S 17.9 0.1 0:21.70 httpd
    18248 xxxxx 20 0 1446m 26m 4756 S 16.9 0.1 0:03.51 httpd
    16479 xxxxx 20 0 1461m 41m 4688 S 16.2 0.2 0:19.24 httpd
    16870 xxxxx 20 0 1458m 37m 4216 S 16.2 0.2 0:16.59 httpd
    18452 xxxxx 20 0 1474m 54m 4652 R 14.2 0.2 0:01.97 httpd
    16729 xxxxx 20 0 1461m 40m 4208 S 12.2 0.2 0:18.65 httpd
    16978 xxxxx 20 0 1455m 35m 4248 S 9.3 0.1 0:11.55 httpd

    Can anyone help me out with this? What happened? This is the first time I see my server getting crippled after a WP update and I’ve run this particular site on WP since 2008.

Viewing 15 replies - 46 through 60 (of 96 total)
  • @compute

    Thx, but after activating the plugin “wp crontrol” shows furthermore the following https://take.ms/FeW9t I do not know why and what to do :/

    @hummelmose Its just a normal plugin. It stops WordPress 4.3 from keep spamming the cron option – but it does not remove the currently wrong cronjobs (will do soon if a 4.3.1 is not around the corner).

    @rené Yes the plugin only stops the new spam cronjobs. The idea is to remove the current spam cronjobs if the plugin gets approved to the .org directory anytime soon.

    @compute – But with the fix in Taxonomy.php and the cleanup in my DB I don’t need it right ?

    @hummelmose Right ?? This is just a fix without hacking the core files.

    Thanks – I expected that.

    But great you make a version that easily can clean up the “mess” ??

    The fix does not create load.

    The hell it doesn’t. Once I finally figured out that I needed to delete it a few seconds after it started running (or else it would spawn hundreds of more instances, as more users visit my site) – and even AFTER I added a sleep to that script, it still caused heavy load on my server for over an hour before I abandoned that method and just went in and edited the database manually. I think you fail to realize that servers effected by this issues have 1000s of these damn cron jobs to get rid of, and looping through them while the server is under load is just asking for trouble… especially if each visitor to the site causes another loop job to be spawned.

    On top of that, this “Fix” was available on Wednesday, yet for some reason it has not been implemented in the 4.3 code which is currently available from WordPress. Which means 1000s more sites are being needlessly effected by this bug each day. I didn’t install 4.3 on my site until Thursday, the day after this bug was fixed.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Fair enough. Thousands and thousands of entries, I have not seen. In my instance, it only had maybe 400 entries, and was cleaned up in under a few seconds.

    Here is alternative code which does the same operation without making a database call for every single entry.

    <?php
    function clear_bad_cron_entries() {
    	// Fix incorrect cron entries for term splitting
    	$cron_array = _get_cron_array();
    	if ( isset( $cron_array['wp_batch_split_terms'] ) ) {
    		unset( $cron_array['wp_batch_split_terms'] );
    	        _set_cron_array( $cron_array );
    	}
    }
    clear_bad_cron_entries();

    Try this one instead if you’re having problems with the first one. Note that the first one does work, but yes, it will cause lots of SQL to be run to fix the issue. This one does the same thing in one pass, with only one SQL statement.

    On a multisite, will running the upgrade network be sufficient for running the mu-plugin on every site or will we need to actually load each site?

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    On a multisite, if you update to 4.3.1, then the “upgrade network” process will do the job for you there. The code in my last post here is the new code that will be included in 4.3.1 to clean this mess up.

    If you are trying to clean it up now, and you are using the above code in a mu-plugin, then “upgrade network” will essentially cause a ping to each site which *should* run the mu-plugin code as well. However, if there is nothing for it to actually upgrade, then I don’t believe it will actually ping each site.

    The above code should cause no additional load, since it’s performing only one query to get the cron data, and one additional query to save it back, if it needs to remove the extra entries. So, you can leave it running for a little while and allow normal traffic to the sites to clear the problem up for you.

    Just want to say thanks to Samuel for posting this.

    Our site – https://www.thesportreview.com – was super slow after the 4.3 update – and this fixed it in an instant. Much appreciated.

    Martin

    We are litereally mentally exhausted for about a week trying to solve the root of the problem. We changed theme, disabled plugins, return to default theme… Nothing worked. Nothing! Finally, this topic solved the issue.

    I just hope that WP 4.3.1 comes out soon and fixes the problem good.

    By the way, WordPress should really abandon prior MySQL 5.5 versions. And for the PHP, the minimum should be 5.4.

    Brandy

    (@mommysplurge)

    i give so many +1s for this fix. this took down my site daily since i updated to 4.3. a very sincere thank you!

    @samuel Wood (Otto): How to run script “fix.php”. Sorry, I’m a newbie.

    Solved with two steps.

    Thanks.

    @vi3t it’s clearly stated in his post on page 1. Read it again.

    Thank you millions for this fix. What is the actual reason they haven’t pushed out 4.3.1 yet? I can’t believe it. Who makes these decisions?

Viewing 15 replies - 46 through 60 (of 96 total)
  • The topic ‘High CPU Load After Update to v4.3’ is closed to new replies.