Thanks Niphold for your informative response so If i understood correctly, in my case , I don't need to start 10 different workers as all these 10 tasks will have different time period to run hence one worker will be sufficient to perform the required tasks and in any case, suppose I have to run more than one tasks at the same time period then I should go to the approach of starting more than one workers.
Thanks, Amit On Fri, Nov 9, 2012 at 3:16 PM, Niphlod <[email protected]> wrote: > ehm, missing something here: worker(s) do(es) auto-assignments of tasks. > there's no web2py involved in assigning task to a particular worker. > Said that, I'd run one worker if there are no requisites like "I need > function1 and function2 to run concurrently", in which case, start 2 > workers, they'll split the jobs. > > > On Friday, November 9, 2012 7:59:04 AM UTC+1, Amit wrote: >> >> Hi, >> I have more than 10 functions which has to be executed by Scheduler and >> each task has assigned different time ( for e.g...one has to execute on >> every 15 minutes, other one has to executes on every 24 hrs etc... ) to >> execute, so in my CustomScheduler.py module : I wiil have 10 different >> statements like below: >> >> >> db.scheduler_task.validate_**and_insert( >> function_name='func1', >> args='[]', >> repeats = 0, # run indefinately >> period = 3600, # every 1h >> timeout = 120, # should take less than 120 seconds >> ) >> >> >> >> db.scheduler_task.validate_**and_insert( >> function_name='func2', >> args='[]', >> repeats = 0, # run indefinately >> period = 900, # every 15 min >> timeout = 120, # should take less than 120 seconds >> ) >> >> My doubt is what will be the better optimized approach to assign those >> 10 tasks to Scheduler: >> >> 1. Create only one worker using *web2py -K appname* command for all >> tasks, which will further takes care of running all tasks at designated >> time OR >> 2. Create 10 different workers means execute above command 10 times and >> then web2py takes care of assigning the task to each worker. >> >> which will be the best optimized way to use web2py scheduler? >> >> Regards, >> Amit >> >> -- > > > > --

