[wpkg-users] [Bug 233] Command invokations cause unneccessary delays
bugzilla-daemon at bugzilla.wpkg.org
bugzilla-daemon at bugzilla.wpkg.org
Tue Aug 2 02:32:50 CEST 2011
http://bugzilla.wpkg.org/show_bug.cgi?id=233
Rainer Meier <r.meier at wpkg.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |r.meier at wpkg.org
Resolution| |FIXED
--- Comment #1 from Rainer Meier <r.meier at wpkg.org> ---
Thanks for the input. In fact I've invested slightly more time to implement a
dynamic algorithm.
In fact the algorithm now starts with 10ms polling time. After 100ms it
increases to 100ms polling time. After 1s it falls back to 1s polling time.
As a result short-running tasks will make WPKG terminate almost immediately
while on long-running tasks WPKG prevents hogging the CPU for polling purposes.
The idea is that for long-running tasks (minutes?) it does not matter whether
WPKG at maximum takes 1s longer to complete while for short-running tasks (<1s)
it might matter).
I've tried different values and using shorter polling times than 10ms do not
really provide any real speed up.
As you can see from the comparison below WPKG 1.2.1-RC6 did take around 1:42 in
my tests (extended to 100 checks). With your modification the execution dime
went down to ~0:12. With my changes proposed for version 1.2.1-RC7 I've managed
to reach ~0:03. Well, from almost 2 minutes to 2 second it is definitely a big
step.
Please note that this test case is a very extreme case where 100 commands are
executed which all are supposed to terminate within a few ms run time. In
practical most packages will not be handled significantly faster.
FIX: Fixed long execution run times if many short-running external commands are
invoked. For example if many execute-style checks were invoked and each
check finished its task in less than 1s time, then WPKG would wait at
least 1 second for it to finish. Unfortunately WSH is not very advanced in
handling child processes but the algorithm has been changed in a way that
for the first 100ms of run time the child status is checked every 10ms.
For the next 1000ms the status is checked every 100ms. If the task is not
finished by then the task will be checked for termination once per second.
This allows short-running tasks to terminate quickly while preventing high
WPKG load for monitoring on long-lasting tasks.
Fixes bug 233. Thanks to Malte Starostik für suggestion.
Download it here:
<http://wpkg.svn.sourceforge.net/viewvc/wpkg/wpkg/stable/1.2/>
Comparison:
Results using 100 trivial checks of type "<check type="execute" path="cmd
/cecho."/>".
WPKG 1.2.1-RC6:
$ time cscript wpkg-1.2.1-RC6.js /synchronize
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.
2011-08-02 02:23:08, STATUS : Starting software synchronization
2011-08-02 02:23:08, STATUS : Number of packages to be removed: 0
2011-08-02 02:23:08, STATUS : Install: Verifying package 'Execution Speed
Demo' (1/1)
2011-08-02 02:24:49, STATUS : Finished software synchronization
real 1m42.478s
user 0m0.015s
sys 0m0.015s
WPKG 1.2.1-RC6 modified by Malte:
$ time cscript wpkg-malte.js /synchronize
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.
2011-08-02 02:21:20, STATUS : Starting software synchronization
2011-08-02 02:21:20, STATUS : Number of packages to be removed: 0
2011-08-02 02:21:20, STATUS : Install: Verifying package 'Execution Speed
Demo' (1/1)
2011-08-02 02:21:31, STATUS : Finished software synchronization
real 0m11.313s
user 0m0.000s
sys 0m0.031s
WPKG 1.2.1-RC7 proposal:
$ time cscript wpkg-1.2.1-RC7.js /synchronize
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.
2011-08-02 02:22:03, STATUS : Starting software synchronization
2011-08-02 02:22:03, STATUS : Number of packages to be removed: 0
2011-08-02 02:22:03, STATUS : Install: Verifying package 'Execution Speed
Demo' (1/1)
2011-08-02 02:22:05, STATUS : Finished software synchronization
real 0m2.524s
user 0m0.000s
sys 0m0.031s
--
Configure bugmail: http://bugzilla.wpkg.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the wpkg-users
mailing list