Thank you very much Tim, excelent info. I will use web2py's Scheduler, because it will be easy to write some code and let the user change the configuration from the webapp.
However, I have one last concern about system resources on production.
In my case, I will be running a service for each instance of web2py running, but as I said, each scheduler will correspond to the sending of a daily newsletter, that is, each scheduler will execute only one task per day. Therefor my doubt: ¿does the scheduler consume much resources being "idle" waiting for tasks to be queued?
In the other hand, after reading web2py's scheduler documentation, I found out that, if I want to schedule a task that runs every day at a certain time, I would have to queue the task in this way:
scheduler.queue_task(
send_newsletter, # the function that sends the newsletter
start_time=first_execution, # first_execution would be, for example, tomorrow at 8am
period=86400, # one day, expressed in seconds
repeats = 0 # unlimited repeats
)
Is that ok? If I do it this way, should I increase the heartbeat to 60 seconds or more? That is, taking into account that the scheduler will only have to run one task per day.