Docket Cache Conflicts with Cron Jobs
-
First off, our site is quite large, and we have already noticed some significant speed improvements using this plugin. So, we would really love some help to figure out the issue below so that we can keep using the plugin.
The problem is that this plugin is messing with our cron jobs. Here’s the scenario.
The Setup
We have disabled WordPress cron on our website using the following piece of code:
define('DISABLE_WP_CRON', true);
We then created a real linux cronjob that is triggered every 15 minutes via an external server (not the server hosting the site). The command that gets triggered every 15 minutes is:
wget -q -O - https://ourdomain.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
This setup has been working very well for us for many years until we started using Docket Cache a couple of days ago.
We have disabled the Docket Cronbot Service (never used it at all).
When we began to notice conflicts with Docket Cache, we cleared both Docket Caches, and restarted the server.
For test purposes, we created a cron event (10 minute recurrence) using the WP Crontrol plugin. This cron event just sends us an email every time it runs. It does nothing else.
The Problem:
After our first real linux cron job is triggered, when Docket Cache is enabled, we start to get calls to WordPress cron every 3 minutes (instead of the 15 minutes that we configured externally). The real problem is that all the calls to WordPress cron fail constantly. This can be seen from our server logs:2022/08/02 20:30:01 [error] 1399#1399: *44367 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 66.248.200.18, server: ourdomain.com, request: "GET /wp-cron.php?doing_wp_cron HTTP/1.1", upstream: "fastcgi://unix:/var/php-nginx/164280564033490.sock/socket", host: "ourdomain.com" 2022/08/02 20:33:01 [error] 1399#1399: *44949 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 66.248.200.18, server: ourdomain.com, request: "GET /wp-cron.php?doing_wp_cron HTTP/1.1", upstream: "fastcgi://unix:/var/php-nginx/164280564033490.sock/socket", host: "ourdomain.com" 2022/08/02 20:36:01 [error] 1399#1399: *45732 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 66.248.200.18, server: ourdomain.com, request: "GET /wp-cron.php?doing_wp_cron HTTP/1.1", upstream: "fastcgi://unix:/var/php-nginx/164280564033490.sock/socket", host: "ourdomain.com" 2022/08/02 20:39:01 [error] 1399#1399: *46339 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 66.248.200.18, server: ourdomain.com, request: "GET /wp-cron.php?doing_wp_cron HTTP/1.1", upstream: "fastcgi://unix:/var/php-nginx/164280564033490.sock/socket", host: "ourdomain.com" 2022/08/02 20:42:01 [error] 1399#1399: *46971 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 66.248.200.18, server: ourdomain.com, request: "GET /wp-cron.php?doing_wp_cron HTTP/1.1", upstream: "fastcgi://unix:/var/php-nginx/164280564033490.sock/socket", host: "ourdomain.com"
From the date and time of each line above, you can see that the issue is occurring every 3 minutes. The effect of this is that our 10 minute cron event that sends us an email now sends the email every 3 minutes. All other WordPress cron events are also getting re-triggered every 3 minutes. This cannot be good at all. Some cron events are scheduled to run daily. Others weekly. 3 minutes re-execution of ALL WordPress cron events is a problem for sure. The even bigger problem is the fact that all calls to WordPress cron now fail (as shown in the server logs above).
When we clear the Docket Caches and disable the Docket Cache plugin, everything goes back to normal: Calls to wp-cron.php no longer fail (no new doing_wp_cron errors in the logs). And our 10 minute WordPress cron event sends out the email notification every 10 minutes as expected. As soon as Docket Cache is re-enabled, the problem starts again.
Here’s Our Docket Cache Overview Page:
Web Server nginx / 1.18.0 PHP SAPI 7.4.3 / cgi-fcgi (Linux) Object Cache Stats 125M object of 214565 files Object OPcache Stats 1G memory of 511004 files WP OPcache Stats 94M memory of 4148 files PHP Memory Limit 5G WP Frontend Memory Limit 40M WP Backend Memory Limit 5G Drop-in Writable Yes Drop-in File /wp-content/object-cache.php Cache Writable Yes Cache Files Limit 214565 / 1000000 Cache Disk Limit 236M / 5G Cache Path /wp-content/cache/docket-cache Chunk Cache Directory Yes Config Writable Yes Config Path /wp-content/docket-cache-data
We took a look into the code of the plugin and noticed that it indeed has some components that do stuff with wp-cron.php and doing_wp_cron GET requests. But before investigating this too far, we decided to ask for help here instead.
Looking forward to your reply.
Thank you.
- The topic ‘Docket Cache Conflicts with Cron Jobs’ is closed to new replies.