imJexs Posted November 8, 2021 Posted November 8, 2021 Hey there! I'm looking for information regarding the frequency of the cronjob/task. For context, we're moving our site from AWS Elastic Beanstalk where I was able to force the cronjob to only run on 1 server in the auto-scaling group. However, we're moving to a Docker Swarm infrastructure where this isn't quite as easy. So the question is, if I have, let's say, 6 instances of IPS running in the swarm, is it bad if they are all hitting the cron every minute? Should the cron only be called once a minute, or is once a minute the maximum recommended time? In this setup, we would be hitting the cronjob 6 times/minute (or really however many instances/replicas of the web server we have spun up). Obviously our alternative is to just setup a separate job/container that just calls the "core/interface/task/web.php" remotely. Maybe that's just the smarter thing to do regardless. Any insight into this would be appreciated. Cheers!
Solution Jim M Posted November 8, 2021 Solution Posted November 8, 2021 The maximum time for the cron job to run would be 1 minute. If the time exceeds this than some unintended consequences may happen. There are checks and balances for running less than 1 minute but it still may cause some processing overhead on your end. Ideally, 1 minute is the recommended time to run it. If you encounter issues with a configuration that does it more frequent, our remedy most likely would be to change that so it is at 1 minute. Birgit Schultz and imJexs 1 1
imJexs Posted November 8, 2021 Author Posted November 8, 2021 19 minutes ago, Jim M said: The maximum time for the cron job to run would be 1 minute. If the time exceeds this than some unintended consequences may happen. There are checks and balances for running less than 1 minute but it still may cause some processing overhead on your end. Ideally, 1 minute is the recommended time to run it. If you encounter issues with a configuration that does it more frequent, our remedy most likely would be to change that so it is at 1 minute. That makes sense. I'll just play it on the safe/recommended side and run an external service to trigger it remotely every minute. Thanks!
Recommended Posts