Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Launch multiple VBS simultaneously

Status
Not open for further replies.

Mich

IS-IT--Management
Dec 26, 2000
452
US
I'm currently testing an application that extracts data from SQL to text files then FTPs the data. All of that works fine, but I need to determine if it is better to set the extracts up in sequence or if I can run them all at once OR where is the line that determines one process is better than the other. For example, running 32 extracts simultaneously is quicker than running them in sequence, but running 33 simultaneously is slower.

Now, I can run them in sequence by using wshshell.run with the true flag, but how do I run them all at once and time when they finish? I want to launch them all, have vb wait for them to finish, then report the time.

Ideas?

-If it ain't broke, break it and make it better.
 
Are there any dpendencies the scripts have on one another, or are they all doing their own thing (making their own log file for example)?

If they're all doing their own thing, id think you should be fine with kicking off multiple scripts at once....however, if they are dependent on each other (aka, 3rd script requires data that is fed back to a file from the 1st script for example), then they should be ran in sequence, or at least wscript.sleep statements sprinkled throughout to give time for data gathering.

- Brandon Wilson
MCSE:Security00/03; MCSA:Security03
MCSA:Messaging00; MCP; A+
IT Pangaea (
 
They are all connecting to separate databases and writing their own files. The concern I have is the load that will be placed on the server launching the scripts when they are all ran at the same time.

It's been my experience that scripts, especially those that write to text files, tend to be pretty CPU intensive.

-If it ain't broke, break it and make it better.
 
depends on what theyre writing really. in this case, i would expect the calls to the database to be more intensive.

the only way to really tell though is to baseline test the method. there are times i write code assuming it will be to resource intensive, only to later build one for testing and find out it was nearly as bad as i thought.

- Brandon Wilson
MCSE:Security00/03; MCSA:Security03
MCSA:Messaging00; MCP; A+
IT Pangaea (
 
Yeah, that is what I'm doing right now. I was trying to avoid it because now I have to install 140 instances of SQL.

-If it ain't broke, break it and make it better.
 
ahhh i gotcha.
in that case, just alter the scripts to all make the exact same call to the exact same database and still report to their own individual files?
it doesnt matter, as far as baseline resource utilization checking, where they point to, all that matters is that do some query to the database and that they all still write to their own files. one database call over another should not add any significant increase in resource utilization.

- Brandon Wilson
MCSE:Security00/03; MCSA:Security03
MCSA:Messaging00; MCP; A+
IT Pangaea (
 
Well, it isn't so much to test the server's CPU performance or the database's performance as it is to test the script's performance. The determining factor is time to run which includes the performance of the server, db, etc. If I run all of the scripts against the same db then I'm introducing an increased load on the db that will not exist in production.

I have a script that contains the T-SQL I need to extract data. I also have "caller" scripts that that connect to the individual instances and launch the extract script. Now, to test I need to execute a sample number of these caller scripts at once so I have built a test "caller" script to run through the extract "caller" scripts. Get's a bit confusing.

Here's my problem, I can launch the extract caller scripts simultaneously using wshshell.run with a false flag, but how do I report when ALL of the scripts have finished??

-If it ain't broke, break it and make it better.
 
ah i gotcha

create an additional file and use it for logging a "status=complete" type of message into the file for each script that runs

then when you are ready in your code to do your checks, simply iterate through the lines of that file, counting each line, and throw a do until loop in there until your counting variable = the number of lines expected in the file.

did i just confuse things more for ya?

- Brandon Wilson
MCSE:Security00/03; MCSA:Security03
MCSA:Messaging00; MCP; A+
IT Pangaea (
 
Ahhh, I'm onto you now.

The extract scripts are vendor generated and I have been trying to test with a caller script. I need to modify the extract scripts to write to a file reporting when their done.

Let me test this.

-If it ain't broke, break it and make it better.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top