We have a scheduled machine which has hasn’t been getting run with the following error:
could not reserve resource for machine: insufficient memory available to fulfill request
This scheduled machine runs some important cron-like tasks for our production application so it very much needs to be run on the specified schedule. How do I fix this as we have tasks queuing up from this machine not running?
This means the machine was on a host that didn’t have enough memory available when the scheduled task was scheduled to start.
Generally the way around this is to have multiple machines (they get spread around different hosts). In your case, since it’s a CRON-like behavior, you’ll likely want to do 2 things:
Spin up at least 2 machines
Add a “locking” mechanism is only one machine runs the actual work (assuming that’s what is appropriate for your situation).
This is often done with Redis. At one point we provided Consul for locking like this, I have to check to see if that’s available on our latest apps platform.