Title: Cache clear cause high server load
Last modified: October 19, 2016

---

# Cache clear cause high server load

 *  Resolved [longnha](https://wordpress.org/support/users/longnha/)
 * (@longnha)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/cache-clear-cause-high-server-load/)
 * Hello,
 * I disabled cron job and set up manual cron run each 30 mins via cpanel.
 * I notice that each time cron is run, the cache is cleared the server is overloaded
   and it take around 20 minutes for the load back to normal!
 * The site has around 15k post, 4500 tags and 300 categories.
 * Max Object Size 128000
    Cache Expire Time (seconds) 86400 Cache Stale Age (seconds)
   10
 * I starting to notice the issue a few days ago after upgrade to PHP7, but the 
   issue may be there before I just did not notice yet!
 * Could it be a known issue?
 * Thank you.

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [LiteSpeed Technologies](https://wordpress.org/support/users/litespeedtech/)
 * (@litespeedtech)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/cache-clear-cause-high-server-load/#post-8328715)
 * Hi longnha,
 * What actions do you take during your cron jobs? I’d like to know which options
   you have checked in the purge rules settings as well.
 * Thanks,
    Kevin
 *  Thread Starter [longnha](https://wordpress.org/support/users/longnha/)
 * (@longnha)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/cache-clear-cause-high-server-load/#post-8328765)
 * Hi Kevin,
 * Purge rule: [http://imgur.com/a/tgySK](http://imgur.com/a/tgySK)
 * Active cron via phpadmin: [http://imgur.com/yTtDKuG](http://imgur.com/yTtDKuG)
 * Thanks.
 *  Thread Starter [longnha](https://wordpress.org/support/users/longnha/)
 * (@longnha)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/cache-clear-cause-high-server-load/#post-8328790)
 * Also, each time the issue happen, I notice the homepage response header:
 * vary:Accept-Encoding
    x-litespeed-cache-control:public,max-age=1800 x-litespeed-
   tag:B1_F,B1_
 * It different with normal status:
 * server:LiteSpeed
    status:200 vary:Accept-Encoding x-litespeed-cache:hit
 * Thank you.
 *  Plugin Author [LiteSpeed Technologies](https://wordpress.org/support/users/litespeedtech/)
 * (@litespeedtech)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/cache-clear-cause-high-server-load/#post-8328861)
 * So I believe that you might have something updating during the cron job. For 
   whatever reason, everything gets purged when the cron job hits.
 * If you are comfortable editing code, please go to our file litespeed-cache/includes/
   class-litespeed-cache.php
    Inside, there is a function add_purge_tags. At the
   top of the function add the following: `error_log('purge tags ' . $tags);`
 * So that it looks like:
 *     ```
       	private function add_purge_tags($tags, $is_public = true)
       	{
       error_log('purge tags ' . $tags);
       		//TODO: implement private tag add
       		if (is_array($tags)) {
       			$this->pub_purge_tags = array_merge($this->pub_purge_tags, $tags);
       		}
       		else {
       			$this->pub_purge_tags[] = $tags;
       		}
       		$this->pub_purge_tags = array_unique($this->pub_purge_tags);
       	}
       ```
   
 * Once this line is added, an error log should be printed out every time something
   is purged. You can test this by pressing the purge front page button in the litespeed
   cache management page. Once confirmed, wait for the cron to activate, and check
   the error log – there should be new messages. We’re interested in what tags are
   purged.
 * Thanks,
    Kevin
 *  Thread Starter [longnha](https://wordpress.org/support/users/longnha/)
 * (@longnha)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/cache-clear-cause-high-server-load/#post-8329121)
 * Hello,
 * Yes, I edit the file and add the line. Where can I check the error log please?
 * Thanks.
 *  Plugin Author [LiteSpeed Technologies](https://wordpress.org/support/users/litespeedtech/)
 * (@litespeedtech)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/cache-clear-cause-high-server-load/#post-8329142)
 * There are multiple possibilities, all depending on how your server was installed.
   
   The first place to check is your where your wordpress’s index.php file is, so
   if it is at /home/user/public_html/index.php, look for /home/user/public_html/
   error_log. Else you could have your own error log, /home/user/logs/error_log.
   Else it could be at /usr/local/apache/logs/error_log or /usr/local/lsws/logs/
   error.log

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Cache clear cause high server load’ is closed to new replies.

 * ![](https://ps.w.org/litespeed-cache/assets/icon-256x256.png?rev=2554181)
 * [LiteSpeed Cache](https://wordpress.org/plugins/litespeed-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/litespeed-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/litespeed-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/litespeed-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/litespeed-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/litespeed-cache/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [LiteSpeed Technologies](https://wordpress.org/support/users/litespeedtech/)
 * Last activity: [9 years, 7 months ago](https://wordpress.org/support/topic/cache-clear-cause-high-server-load/#post-8329142)
 * Status: resolved