Cache clear cause high server load




Wordpress LScache Plugin: Cache clear cause high server load

Last Updated on: Wed, 15 Apr 2026 00:00:02
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. Hi longnha, What actions do you take during your cron jobs? Id like to know which options you have checked in the purge rules settings as well. Thanks, Kevin Hi Kevin, Purge rule: http://imgur.com/a/tgySK Active cron via phpadmin: http://imgur.com/yTtDKuG Thanks. 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. 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. Were interested in what tags are purged. Thanks, Kevin Hello, Yes, I edit the file and add the line. Where can I check the error log please? Thanks. There are multiple possibilities, all depending on how your server was installed. The first place to check is your where your wordpresss 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



LiteCache Rush: Speed comes from using less, not from doing it faster



Reference