High CPU load
-
<font _mstmutation=”1″></font>Hi, with preload CPU load increases to 100%, without preload more to 40%. I have 4 CPU cores and 8GB RAM on my server. WooCommerce store, 30,000 products, 500 categories, 44,000 attachments, only products, attachments, categories are included in the sitemap
-
I can give you some filters that would throttle the Preload;
– 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);
That 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).I put this in functions.php and got an error, the site stopped working<font _mstmutation=”1″></font>
//WP-Optimize
add_filter(‘wpoptimize_preload_delay’, ‘my_preload_delay_method’);
add_filter(‘wpo_page_cache_preload_memory_threshold’, 10485760);
add_filter(‘wpo_page_cache_preload_continue_interval’, 600);
Can you try adding via a snippets plugin?
This didn’t help, I get an error when activating
A critical error occurred on the site. Please check the site administrator’s inbox for instructions. If you’re still having problems, visit the support forums.
Learn more about troubleshooting WordPress issues.
There is an error in the logs
2025-01-11T14:31:30+00:00 Critical Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, no array or string given in /var/www/fastuser/data/www/auhouse.ru/wp-includes/class-wp-hook.php:324 Дополнительный контекст{ “error”: { “type”: 1, “file”: “/var/www/fastuser/data/www/auhouse.ru/wp-includes/class-wp-hook.php”, “line”: 324 }, “remote-logging”: true, “backtrace”: [ “”, “#0 /var/www/fastuser/data/www/auhouse.ru/wp-includes/plugin.php(205): WP_Hook->apply_filters()”, “#1 /var/www/fastuser/data/www/auhouse.ru/wp-content/plugins/wp-optimize/includes/class-wp-optimize-preloader.php(49): apply_filters()”, “#2 /var/www/fastuser/data/www/auhouse.ru/wp-content/plugins/wp-optimize/cache/class-wpo-page-cache.php(1535): WP_Optimize_Preloader->get_continue_preload_cron_interval()”, “#3 /var/www/fastuser/data/www/auhouse.ru/wp-includes/class-wp-hook.php(324): WPO_Page_Cache->cron_schedules()”, “#4 /var/www/fastuser/data/www/auhouse.ru/wp-includes/plugin.php(205): WP_Hook->apply_filters()”, “#5 /var/www/fastuser/data/www/auhouse.ru/wp-includes/cron.php(1116): apply_filters()”, “#6 /var/www/fastuser/data/www/auhouse.ru/wp-includes/cron.php(1014): wp_get_schedules()”, “#7 /var/www/fastuser/data/www/auhouse.ru/wp-includes/class-wp-hook.php(324): _wp_cron()”, “#8 /var/www/fastuser/data/www/auhouse.ru/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()”, “#9 /var/www/fastuser/data/www/auhouse.ru/wp-includes/plugin.php(517): WP_Hook->do_action()”, “#10 /var/www/fastuser/data/www/auhouse.ru/wp-settings.php(726): do_action()”, “#11 /var/www/fastuser/data/www/auhouse.ru/wp-config.php(62): require_once(‘…’)”, “#12 /var/www/fastuser/data/www/auhouse.ru/wp-load.php(50): require_once(‘…’)”, “#13 /var/www/fastuser/data/www/auhouse.ru/wp-blog-header.php(13): require_once(‘…’)”, “#14 /var/www/fastuser/data/www/auhouse.ru/index.php(17): require(‘…’)”, “#15 {main}”, “thrown” ] }
<font _mstmutation=”1″></font>This filter is causing the error.
add_filter(‘wpo_page_cache_preload_continue_interval’, 600);
Apologies, I do not get this error when I add this to my site.
If you go into the class-wpo-load-url-task.php, you can change the following settings
https://snipboard.io/Oe9VsG.jpg
Can you try either changing the value here or adding a filter to change the value?
Please check<font _mstmutation=”1″></font>
This filter works – add_filter(‘wpoptimize_preload_delay’, ‘my_preload_delay_method’, 500000);
This filter works – add_filter(‘wpo_page_cache_preload_memory_threshold’, 10485760);
This filter is causing an error – add_filter(‘wpo_page_cache_preload_continue_interval’, 600);
Try the ones that do work for you and see if these help manage your load.
I’ll try to see if there is a way to disable automatic cache clearing when importing products?
This filter helped me to regulate the loading
add_filter(‘wpoptimize_preload_delay’, ‘my_preload_delay_method’, 500000);
Preloading works but the number of pages is shown as “Preloading posts found in sitemap: 0 out of 31661 preloaded URLs”, the value 0 does not change
This sounds like something different, can you post your php error logs,
Could you send me the link to your site map?
What are you using to generate your sitemap?
There are no errors in the logs
https://auhouse.ru/sitemap.xml
Standard WP sitemap, no SEO plugins used
-
This reply was modified 1 year, 1 month ago by
adio93.
If you open the JS console while preloading, do you see any errors?
Can you try using Yoast to generate a sitemap to see if that makes any difference?
-
This reply was modified 1 year, 1 month ago by
The topic ‘High CPU load’ is closed to new replies.