spiritedmedia / systems

Code and documentation for building, deploying, and serving code.
1 stars 1 forks source link

Move to an External Cron #42

Closed kingkool68 closed 6 years ago

kingkool68 commented 6 years ago

Currently each machine runs a WP CLI script every minute to manage cron events (See https://github.com/spiritedmedia/systems/commit/b279d5c2b117144ad385f437f0d681afe0444ac1)

The problem with doing this in production is we have multiple servers running at a given time which means the cron events are triggered multiple times per minute. The best way to resolve this would be to use an external cron service that pings one URL so the cron job is only triggered once per minute regardless with how many machines are running in production.

Possible solutions:

Either solution would also require us to set-up a PHP script that the external cron would hit so whenever we add a new site we don't need to manually update the external cron script. See https://tribulant.com/blog/wordpress/replace-wordpress-cron-with-real-cron-for-site-speed/