scheduler speed up task run

21 views
Skip to first unread message

Yebach

unread,
Aug 14, 2017, 4:35:05 AM8/14/17
to web2py-users
Hello

I am experiencing some issues with scheduler.py module

While running on my local machine (Windows 10, postgres database,..) the scheduler under the following command start relatively quick

scheduler = Scheduler(db, tasks = dict(runWoshiEngine = runWoshiEngine,saveIdOut=saveIdOut ) ,heartbeat = 1)
 
Lets say under 1 second. 

On my server machine (Windows server 2008, postgres db, etc....) there is a huge delay when scheduler starts. about 20-30 seconds.

Any suggestions on what the issue migh tbe

Trough schedule I run an external exe application

The code:

How I call schedule 

task = scheduler.queue_task(runWoshiEngine, [scriptId, path, parallel])

in my scheduler.py 

def runWoshiEngine(scriptId, path, parallel):
# import os, sys
# import time
import subprocess
#UKAZ - woshi_engine.exe skripta.lls -4
#print "runWoshiEngine in progress...... with %s parallel instances" % (str(parallel))
if parallel == 0:
woshi_input_string = 'woshi_engine.exe ' + str(scriptId)
else:
parallel_str = " -p%s" % (str(parallel))
woshi_input_string = 'woshi_engine.exe ' + str(scriptId) + parallel_str

#print "engine run for script %s with %s parallel instances" % (str(scriptId), str(parallel))
print woshi_input_string
#p = subprocess.Popen([woshi_input_string], shell=True, stdout = subprocess.PIPE, cwd=path) #- ne dela na serverju - Blage zakaj
#p = subprocess.Popen(['woshi_engine.exe', woshi_input_string], shell=True, stdout = subprocess.PIPE, cwd=path)
p = subprocess.Popen(woshi_input_string, shell=True, stdout = subprocess.PIPE, cwd=path)
return dict(status = 1)

scheduler = Scheduler(db, tasks = dict(runWoshiEngine = runWoshiEngine,saveIdOut=saveIdOut ) ,heartbeat = 1)

any suggestions ?

thank you



Reply all
Reply to author
Forward
0 new messages