3 ms·
Anyone know if there's a self-contained way to spool up a dyno sporadically to complete scheduled tasks? I have a webapp now that's hosted on a VPS and uses Ce
by sparky 15y ago
Anyone know if there's a self-contained way to spool up a dyno sporadically to complete scheduled tasks?
I have a webapp now that's hosted on a VPS and uses Celery to schedule tasks. The tasks themselves only take about a second, the dyno needs to stay active for ~5 minutes to service a bunch of HTTP requests from another webservice that will result from the task, and then shut down until the next task. There are O(100) tasks spaced throughout the day, and they each must be completed at a very specific time. My aggregate dyno-hour requirements are very low, but I haven't figured out a way for a dyno to turn itself on and off for scheduled tasks this way. Admittedly, my use case is a bit niche, but a solution sure would be useful. Whiteboxing my webapp in such a way that it could be deployed on Heroku would be great, but keeping a dyno running all month to run the Celery polling process, when 'actual' computing is happening << 1 percent of the time, is a bit steep :)
- aaronbrethorst 15y agoUse a single dyno, and set the caller's HTTP timeout threshold to a high enough point that it can deal with the delay associated with reallocating your app.