Stress test with sikuli

Asked by Fernando Sibaja

Is there a way to run several sikuli scripts at once? We need to implement a stress test with several clients running at the same time (not a web app).

I imagine there should be several ways of achieving this, do you have any suggestions? Or isnt sikuli the right tool for this particular need?

PD: By several I mean 500 or more.
Regards.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

--- Is there a way to run several sikuli scripts at once?
Principally yes.

If you are talking about one machine:

-1 A few scripts might be run from command line in parallel, but each script consumes at least 100 -200 MB of memory. So it will start to get slow very early depending on your machine's power.

-2 To share the base memory consumption of Sikuli, you can use Pythons threading feature to make a dispatcher for your scripts.

But you have to be aware, that when using mouse and keyboard actions with -1 you do not have any coordination and the scripts will interfere each other.
With -2 you have at least the possibility to set up some locking to prevent simultaneous use of mouse and keyboard.

If I did not get you right, come back with more detailed information about what you want to do.

Revision history for this message
Fernando Sibaja (cafealternativo) said :
#2

Thank you very much for your prompt response.

If I use option 2, Will the fact that they will be using the same client (different instances) would be a problem? I mean, having the same buttons and interface.

Revision history for this message
Best RaiMan (raimund-hocke) said :
#3

You talked about 500 client app instances running simultaneously.

Since Sikuli can only "see" what is currently visible on the screen, the area to show up for the client app windows is somehow restricted.
Usage of multiple monitors is possible.

For Sikuli to act (mouse, keyboard) on the client app, its window must be the frontmost.
Using switchApp() to do this, needs the window titles to be different for each client app (on Windows).

Since it is possible then to restrict the search area to this frontmost window, only this interface will be "seen" (region of interest) by Sikuli's find operations.

Generally I doubt, that it will be possible to run that many scripts in parallel, even with some tweaking of the respective settings. So every chance must be taken to restrict the search areas to the smallest possible regions.

The image search is number cruching of arrays of bytes, which tends to use up to 100 % cpu (if available) during the search. Example: If you succeed in reducing the average search time to a value near 0.01 seconds, and each action block on a client app needs 5 searches, then you might be able to act on about 5 app windows - if everything is optimized.

Always have in mind: the fastest search is the one, that does not happen - because you have e.g. calculated the next click point based on something that already was found before or even with respect to the window bounds - there are many options to avoid searches (e.g keyboard shortcuts, tabbing through GUI fields, ...). People who start using Sikuli tend to search too often.

Revision history for this message
RaiMan (raimund-hocke) said :
#4

Uuups:
.... then you might be able to act on about 5 app windows per second - .....

Revision history for this message
Fernando Sibaja (cafealternativo) said :
#5

Thanks RaiMan, that solved my question.