Title: Reduce CPU usage?
Last modified: May 25, 2023

---

# Reduce CPU usage?

 *  Resolved [aaron843](https://wordpress.org/support/users/aaron843/)
 * (@aaron843)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/reduce-cpu-usage/)
 * Is there a way to throttle back CPU usage while crawling the site? Can we set
   a delay or number of pages/time?

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

 *  Thread Starter [aaron843](https://wordpress.org/support/users/aaron843/)
 * (@aaron843)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/reduce-cpu-usage/#post-16769041)
 * Does this still work? I tried setting it to 5 minutes, and CPU is still hitting
   87%. I’m getting emailed warning from the server every few minutes.
 *     ```wp-block-code
       add_filter( 'wpoptimize_preload_delay', function( $original_delay ) {
           return 300000000; // Delay in microseconds, 1000000 = 1s
       } );
       ```
   
 *  Plugin Support [vupdraft](https://wordpress.org/support/users/vupdraft/)
 * (@vupdraft)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/reduce-cpu-usage/#post-16771614)
 * There are several parameters you can play with:
   – Using;
 * add_filter(‘wpoptimize_preload_delay’, ‘my_preload_delay_method’),
 * you can override the delay between two pages, which is currently set at 500000(
   1/2 a second).
 * – Using;
 * add_filter(‘wpo_page_cache_preload_memory_threshold’, 10485760);
 * 
   This filter lets you change how much memory should be left before interrupting
   the preload queue (10MB by default).
 * – Using;
 * add_filter(‘wpo_page_cache_preload_continue_interval’, 600);
 * 
   This filter enables to change the time before the preload resumes when interrupted(
   600s by Default).
 *  Thread Starter [aaron843](https://wordpress.org/support/users/aaron843/)
 * (@aaron843)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/reduce-cpu-usage/#post-16773661)
 * Is that the complete code? I get the following error when I try what you wrote:
 *     ```wp-block-code
       Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, no array or string given
       ```
   
    -  This reply was modified 2 years, 11 months ago by [aaron843](https://wordpress.org/support/users/aaron843/).
 *  Plugin Contributor [Venkat Raj](https://wordpress.org/support/users/webulous/)
 * (@webulous)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/reduce-cpu-usage/#post-16776346)
 * [@aaron843](https://wordpress.org/support/users/aaron843/) You can’t supply a
   numeric value to `add_filter` call. It should be
 *     ```wp-block-code
       add_filter('wpo_page_cache_preload_continue_interval', function($interval) {
         return 1200;
       });
   
       add_filter('wpo_page_cache_preload_memory_threshold', function($threshold) {
         $new_threshold = 1234; // you desired number
         return $new_threshold;
       });
       ```
   
 *  Thread Starter [aaron843](https://wordpress.org/support/users/aaron843/)
 * (@aaron843)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/reduce-cpu-usage/#post-16777676)
 * Thanks I’ve tried a delay of 5 minutes. It seems there are still 5 or 6 processes
   that launch immediately. So I don’t know if it’s using the settings.
 * I set both wpo_page_cache_preload_continue_interval and wpoptimize_preload_delay
   to 300000000. This resulted in the creation of about 1.6 new cache files per 
   minute over a period of 45 minutes. Server CPU loads are around 35%-70%. But 
   I’m still getting warning emails that the CPU is hitting as much as 90% usage(
   normally it’s under 10% but hard to verify if this is all from cache building.)
 * I’ll continue to experiment to see what these values result in.
    -  This reply was modified 2 years, 11 months ago by [aaron843](https://wordpress.org/support/users/aaron843/).
    -  This reply was modified 2 years, 11 months ago by [aaron843](https://wordpress.org/support/users/aaron843/).
    -  This reply was modified 2 years, 11 months ago by [aaron843](https://wordpress.org/support/users/aaron843/).
    -  This reply was modified 2 years, 11 months ago by [aaron843](https://wordpress.org/support/users/aaron843/).

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

The topic ‘Reduce CPU usage?’ is closed to new replies.

 * ![](https://ps.w.org/wp-optimize/assets/icon-256x256.png?rev=1552899)
 * [WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance](https://wordpress.org/plugins/wp-optimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-optimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-optimize/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-optimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-optimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-optimize/reviews/)

## Tags

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

 * 5 replies
 * 3 participants
 * Last reply from: [aaron843](https://wordpress.org/support/users/aaron843/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/reduce-cpu-usage/#post-16777676)
 * Status: resolved