px307

in stress test ,some autoit process not exit normally

18 posts in this topic

recently i am doing stress test, our application is using java to run autoit script on windows2008 ,
the java code is :

   Runtime.getRuntime().exec("cmd /c AutoIt3.exe test.au3")

the script content of test.au2 is only one line :

Exit 0

when the command  run one by one ,all is normal ,but when the command run simultaneously, concurrent count is about 30, 
after a few minute stress test, we found that some  AutoIt3.exe process  never normal exit, they alway exist in process list.
if i run system command ,for example:   exit 0 

not autoit3.exe ,  all processes normal exit, i guess there is some wrong in Autoit3.exe

how to trace the problem or avoid , thanks

the version of Autoit3.exe is 3.3.14.2

Share this post


Link to post
Share on other sites

#2 ·  Posted (edited)

What is the purpose of the stress test going to prove? Why would you run exit 0? Not understanding 

Edited by Earthshine

Share this post


Link to post
Share on other sites

So you run 30 scripts at the same time, and wonder why there are issues, im not surprised honestly.

" not autoit3.exe ,  all processes normal exit "

huh?


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites
12 hours ago, Earthshine said:

What is the purpose of the stress test going to prove? Why would you run exit 0? Not understanding 

because our application uses autoit to run script  heavily ,we want to prove that it can  run 30 scripts at the same time stably for 2 hours, for avoid possible  side effect of script self, we choose the simplest script:  exit 0 

 

5 hours ago, careca said:

So you run 30 scripts at the same time, and wonder why there are issues, im not surprised honestly.

" not autoit3.exe ,  all processes normal exit "

huh?

we run  " cmd /c exit 0  " instead of "cmd /c autoit3 .... "  simultaneously ,  then all processes can normal exit, but with autoit3,  most processes can  normal exit , yet  a few autoit3 process never exit,  we must kill them from task manager

 

please help me  trouble shoot the problem , does  anybody do similar test ? 

thanks

 

Share this post


Link to post
Share on other sites

Just compile the scripts and run them, test that way. I really dont believe autoit was designed to run 30 scripts simultaneously. Why would you ever need that?

You test one (maybe 2 or 3 at the same time) script, compile it, done.

@Jos: What do you think about this? Is this abnormal behaviour?


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites
8 hours ago, careca said:

I really dont believe autoit was designed to run 30 scripts simultaneously.

I honestly do not understand this statement, nor why "some autoit scripts" would not finish as they are all run autonomously. 

@px307,
What does hanging mean? do you see their icon's still in the system tray? 
How exactly do you manage to shell 30 times a script that only have the line "exit 0" in it without the first one being ended?

Jos

1 person likes this

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Do you experience the same issue if you compile your script once, then launch 30 or more instances of this .exe?

 


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

@Jos I think i see where my assumption failed, i cannot run two, running them in SciTe that is.

If i call the exe on a number of scripts by batch file or something it's supposed to work.


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites

I have successfully run multiple copies of the same AutoIt script shelled from a parent application with different parameters. The most I have run is 32 on a server with 32 cores,  although generally it is in the range 8 to 12 on my local workstation. So what you are trying to do is perfectly possible. Some things to try

1 Try adding a sleep()  for a random length of time or a loop doing something  a few times before the Exit 0, to give the script some actual work to do. It may be that your test script is too simple

2 Try starting with launching a smaller number of scripts e.g. 5 to see if it that works and gradually work up 30.

3 Keep a watch on the CPU utilisation. I may be that 30 is just too many for your hardware.  

4 Try slowing the speed at which your Java application can launch a new script by adding a short delay after this line

Runtime.getRuntime().exec("cmd /c AutoIt3.exe test.au3")

 


"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post


Link to post
Share on other sites

#10 ·  Posted

This example runs 100 concurrent AutoIt3 processes without any issues on my laptop and all AutoIt3 processes cleanly close after 10 seconds:

#include<File.au3>
$Filename = _TempFile(@ScriptDir,"~" ,".au3")
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $Filename = ' & $Filename & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
FileWriteLine($filename,"Sleep(10000)")
FileWriteLine($filename,"Exit")
For $x = 1 to 100
    run('"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "' & $filename & '"',@ScriptDir)
Next
sleep(1000)
FileDelete($filename)

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#11 ·  Posted

I still wonder what is the rationale to run any number of source scripts thru AutoIt3.exe instead or running the as many instances of the compiled .EXE. Is there any?


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

#13 ·  Posted

There are significant differences: the stand-alone interpretor has a large footprint by itself, hence N times its actual footprint, has to fetch N times all the includes the source requires (I agree there seem to be none in the OP example but there will be some in any practical-use source), etc.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

#14 ·  Posted

The "compiled script" is the interpreter binary packed with the tokenized script, so agree it could take a little longer in case there are many included files to pickup, but that is only at startup, but other than that, the processes are more or less comparable.

I just tested this way to compare the memory footprint for AutoIt3 and the compiled script and they were more or less the same as expected:

For $x = 1 to 10
    run('"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "atestshell.au3"',@ScriptDir)
Next
For $x = 1 to 10
    run("atestshell.exe",@ScriptDir)
Next

 

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#15 ·  Posted

Sure but as you know the devil is often in the details.

OTOH somethingelse is maybe the source of OP's issue, AV or something else exterior to AutoIt stuff.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

#16 ·  Posted

 Maybe executing so many at once causes a deadlock somewhere, yes 

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

I have run a random number of scripts (each for a random period) - controlled by a master script in an infinite loop - and never encountered any problems.

Edited by czardas
1 person likes this

Share this post


Link to post
Share on other sites

#18 ·  Posted

I also run run many scripts (even not compiled) and I collect responses from those scripts from a main script without issues.
For example, this udf (https://www.autoitscript.com/forum/topic/156395-versatile-multi-ping/#comment-1131267) runs more ping commands at the same time and collects results from each of them.
Here (https://www.autoitscript.com/forum/topic/177999-how-to-change-bgcolor-of-a-control-belonging-to-another-window/?do=findComment&comment=1278754) a funny example where a main script with a gui with 100 labels, spawns 100 separate and not compiled scripts that will change the content and the color of the main gui (save the last 2 script Main.au3 and Child.au3 in the same path and run the Main.au3). When the main script ends, also all child processes will close themselves. it was just for a fun experiment

 


small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now