Title: Cron issues
Last modified: August 18, 2021

---

# Cron issues

 *  Resolved [SteelWagstaff](https://wordpress.org/support/users/steelwagstaff/)
 * (@steelwagstaff)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/cron-issues-3/)
 * We make an open source book publishing platform, that extends and transforms 
   a WordPress multisite into a CMS for books. Each ‘site’ on the network is a book,
   and a given multisite can have hundreds or or more books/sites on it. We host
   several individual multisites/networks on a single AWS server. We use the Roots
   tools Trellis and Bedrock to manage application cofiguration and server provisioning,
   including managing a system cron. We would like to add Koko Analytics as an optional
   tool for all of our book authors, but when we recently activated the full Koko
   cron for all the books/networks on our staging server, the every minute cron 
   job consumed an enormous amount of CPU (close to 100% for about four hours) before
   stabilizing. The CPU appeared to be within accepted usage for about an hour and
   a half before starting to spike again. We decided that the CPU usage was too 
   concerning and turned the cron job off for our server. We’ve read other support
   tickets that seem similar/relevant, like [https://wordpress.org/support/topic/days-of-stats-in-only-one/](https://wordpress.org/support/topic/days-of-stats-in-only-one/)
   and [https://wordpress.org/support/topic/does-koko_analytics_aggregate_stats-need-to-run-every-minute/](https://wordpress.org/support/topic/does-koko_analytics_aggregate_stats-need-to-run-every-minute/)
   and [https://wordpress.org/support/topic/modifying-the-widget-feature-request/](https://wordpress.org/support/topic/modifying-the-widget-feature-request/).
   Basically, we’re trying to determine whether we can safely use this plugin in
   our situation (multiple WordPress multisite networks on a server, each with dozens/
   hundreds of individual sites) and how you might recommend modifying/structuring
   a cron job to scale for our needs. Thanks again for all you do to make privacy-
   respecting web analytics easier!

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

 *  Thread Starter [SteelWagstaff](https://wordpress.org/support/users/steelwagstaff/)
 * (@steelwagstaff)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/cron-issues-3/#post-14782099)
 * Upon closer inspection, I think what may have happened is that the cron jobs 
   were trying to process several days worth of visit data in the uploads/pageviews.
   php file on lots and lots of sites (we had the plugin activated for a while on
   the staging server, but no functional cron job). Is there a recommended way to
   clear the pageviews.php that is storing all the page visit information that the
   cron job would normally save to the database? If we deactivate/reactivate the
   plugin will it flush/dump this file, for example?
    -  This reply was modified 4 years, 9 months ago by [SteelWagstaff](https://wordpress.org/support/users/steelwagstaff/).
    -  This reply was modified 4 years, 9 months ago by [SteelWagstaff](https://wordpress.org/support/users/steelwagstaff/).
 *  Plugin Support [Lap](https://wordpress.org/support/users/lapzor/)
 * (@lapzor)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/cron-issues-3/#post-14782212)
 * I would just manually delete the file via a file manager, Koko will automatically
   re-create it.
 * I am interested to learn how many lines you have in the current pageviews.php
   file for it to cause a 4 hour 100% cpu load!! Could you email the file to me 
   at support [@kokoanalytics](https://wordpress.org/support/users/kokoanalytics/).
   com ? (or if it’s too large for email zip it send send me a download link?)
 * Thanks!
 *  Thread Starter [SteelWagstaff](https://wordpress.org/support/users/steelwagstaff/)
 * (@steelwagstaff)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/cron-issues-3/#post-14782228)
 * There are hundreds, if not thousands, of pageviews.php files on the server — 
   one for each of the books in each of the separate WordPress multisite networks,
   which is part of the problem, I think. We don’t allow access to any part of the
   server via a file manager (too insecure).
 *  Plugin Support [Lap](https://wordpress.org/support/users/lapzor/)
 * (@lapzor)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/cron-issues-3/#post-14784697)
 * ok, I will report the issue to Danny and see if we can reproduce it. I imagine
   it must be an incredible number of views before it takes up such an amount of
   CPU, or maybe there is something else at play still…

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

The topic ‘Cron issues’ is closed to new replies.

 * ![](https://ps.w.org/koko-analytics/assets/icon.svg?rev=2980600)
 * [Koko Analytics - Privacy-Friendly WordPress Analytics](https://wordpress.org/plugins/koko-analytics/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/koko-analytics/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/koko-analytics/)
 * [Active Topics](https://wordpress.org/support/plugin/koko-analytics/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/koko-analytics/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/koko-analytics/reviews/)

## Tags

 * [cron](https://wordpress.org/support/topic-tag/cron/)

 * 4 replies
 * 2 participants
 * Last reply from: [Lap](https://wordpress.org/support/users/lapzor/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/cron-issues-3/#post-14784697)
 * Status: resolved