Slower task scheduler performance

54 views
Skip to first unread message

Carolina Nogueira

unread,
Oct 22, 2014, 11:21:43 AM10/22/14
to web...@googlegroups.com
Hey guys,

I have a performance question about the scheduler. My script is in python3 and when I run directly on a terminal, I have a response time about 2.55s.
If I run exactly the same script inside a scheduler task with subprocess.check_output, my response time is increased by 100 times slower than the direct one.
I'm measuring the response time using the difference from two calls of time.clock(), one at the beginning of the script and a second one whenever it finishes to execute.
Does it make sense?

I'm not quite sure whether I am doing something wrong or not... As far as I understand, the overhead from the web service should be completely located outside the script and not reflect during its execution. What am I missing here? Any direction from where should I look for?
Thanks in advance!

Niphlod

unread,
Oct 23, 2014, 10:27:40 AM10/23/14
to web...@googlegroups.com
if you have a function that launches an external process and it takes 2.55 seconds, it will take the same when launched via the scheduler. The scheduler adds up the time it takes to create the web2py env (usually far less than half a second) in which the function is executed, but your "external process" needs to take the same amout of time in either way. 

nick name

unread,
Oct 26, 2014, 6:37:31 AM10/26/14
to web...@googlegroups.com
On Wednesday, October 22, 2014 6:21:43 PM UTC+3, Carolina Nogueira wrote:
I'm not quite sure whether I am doing something wrong or not... As far as I understand, the overhead from the web service should be completely located outside the script and not reflect during its execution. What am I missing here? Any direction from where should I look for?
Thanks in advance!

My guess would be that locks are involved - something (perhaps your non-scheduler web2py process) is holding a lock for some reason, and the execution inside the scheduler waits for that lock to be released.
Reply all
Reply to author
Forward
0 new messages