Interesting wp-config.php hacks

We ALL know that WordPress just WOULDN'T exist without AWESOME SQL, yeah?

We ALL know that WordPress just WOULDN’T exist without AWESOME SQL, yeah?

I was looking over the logs today and it seems that every minute or two, we get a call to wp-cron.php – and since my server seems to get beat to death at times, I was looking for any way I could to reduce traffic and proc usage. Here’s a a hack or two to keep processor usage down

/** Slow down the whole continual auto-save bullsh*t - AKA heartbeat **/
define( 'AUTOSAVE_INTERVAL', 300 ); // every 5 minutes.
define ('WP_POST_REVISIONS', 3);    // keep only 3 POST REVISIONS

define('DISABLE_WP_CRON', 'true');

In my last post, I flat out disabled heartbeat and that has met with some mixed issues. On several of the sites, it also disabled other functionality that I will have to guess called it up. This is a much better solutions I suspect. So heartbeat doesn’t get completely stopped, but it beats somewhat slower.

We’ve disabled the auto cron stuff so if you do have a lot of a gunk on your site that can chew up processors, this should at least minimize usage of that. IF you do this, you need to setup a MANUAL cron job to run at least occasionally. I went with the once every six hours route. As in this post at, you need it to run, but you definitely don’t need it running every minute or three.

I’ve also got the post revisions in here trimmed to just saving three. It can be sort of neat to see what your page looked like 150 revisions ago (if you’ve had your site for any length of time), but it isn’t necessarily worth tying up huge amounts of table size for.

So let’s see if it DOES manage to hold down some proc usage.

Author: Eric Erickson

Share This Post On

Submit a Comment

Your email address will not be published. Required fields are marked *