Running multiple scripts at the same time

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
lebrocoli
Pro Scripter
Posts: 53
Joined: Tue Sep 06, 2005 9:28 pm

Running multiple scripts at the same time

Post by lebrocoli » Fri May 08, 2009 2:13 pm

I have a beginner question for you:

I have a script that I recorded with 'WebRecorder' that works like a charm. The script opens IE and does some stuff.

In order to simulate database load I would to run let's say 10 instances of the same script on 5 machines.

Is that going to work? Should I compile the script first?

Thanks

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri May 08, 2009 7:50 pm

Unless you compile it you will need 5 licenses to run it on five machines.

If you compile it, make sure you have programmed for the differences in OS, paths, permissions, speed, delays, etc. Perhaps enable logging to help track problems on any system that has trouble.
Last edited by Bob Hansen on Mon May 11, 2009 4:42 pm, edited 1 time in total.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Sat May 09, 2009 12:25 am


gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

More links on load testing and web recorder.

Post by gdyvig » Sat May 09, 2009 3:00 am

Here is another link explaining how to set up load testing including monitoring of the results:

http://www.mjtnet.com/loadtesting.pdf

Marcus provided you with that link last year, but added this:
You could have multiple compiled macros running at once, assuming they are using the WebRecorder runtime and not trying to send keystrokes.
However I believe that restriction only applies when running multiple macros simultaneously from the same desktop. The solution is to use multiple desktops on one physical machine.


I have placed compiled macros on Windows Server 2003. Because it is a server it supports multiple desktops, each of which cold run a separate instance of your script. This would probably be the easiest to set up since you don't need to buy any additional software. You would just have to be careful to avoid collisions when using shared resouces.

We use vmware clients to create multiple desktops, in fact they are totally separate virtual machines. We haven't used them for load testing yet, but this could be done.

We have also borrowed physical machines from our training department when we need to produce a load test.




Gale

lebrocoli
Pro Scripter
Posts: 53
Joined: Tue Sep 06, 2005 9:28 pm

Post by lebrocoli » Mon May 11, 2009 3:14 pm

Ok thanks. I will have a look.

lebrocoli
Pro Scripter
Posts: 53
Joined: Tue Sep 06, 2005 9:28 pm

Post by lebrocoli » Wed May 13, 2009 2:25 pm

Using virtual pc or vmware seems to be a good idea. But we need more info on this.

Let's say I already have created 1 virtual PC image of the computer, all good. NOw, let's say I want to simulate a 25 users load on the system.

- Do I need to create 24 other virtual PC images of the same computer?

- Do I use only 1 virtual PC image but I start it 25 times?

I need more info.

Thanks

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

VMWARE

Post by gdyvig » Wed May 13, 2009 3:36 pm

I don't personally administer the vmware server, but my understanding is:
I don't know the maximum number of clients supported, but do know it depends on how much resources you allocate to each.


The admin creates an image of a real pc.
The admin creates 25 copies on the vmware server.
Each copy is given a unique SID (computer id)

vmware has a console that allows you to stop/start each of the virtual machines. We normally get them all started and leave them running while we perform our testing. If you start the virtual machines from the console (InfraStructure Client) each will run under its own desktop.

You can use a third party scheduling tool to start the compiled scripts. Another way is to put the compiled scripts in a startup folder an use OnEvent (FILE_EXISTS and FILE_NOTEXIST event types against a network file location) to control them.


Vmware also has a tool called Lab Manager. It more efficiently stores the 25 copies by recognizing that each shares an identical configuration. We have not installed it yet.

Of course when using vmware for load testing you will need to verify that it is not the bottleneck.

For more info, check them out at http://www.vmware.com.

If I find out anything new from our vmware admin, I will post more infor to this thread.


Gale

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed May 13, 2009 4:10 pm

Personally I'd go the route of using remote desktop (Windows Terminal Server). That way you can, using Windows Server 2003/2008, run multiple desktops at the same time. We've done this a few times - in fact we're currently working on a project which depends on 25 simultaneous RDP connections. Rather than need multiple licenses and worry about cloning you just need a terminal server license. Windows 2003 server standard includes a license for 5 clients.

Here are details of terminal server licensing:
http://technet.microsoft.com/en-us/sysi ... 97418.aspx

Prices:
http://www.microsoft.com/windowsserver2 ... icing.mspx

If using RDP remember to ensure the scripts aren't trying to access the same resources (may help to use different logins). If a script needs to write to a file or log file make sure the name is unique so they're not all writing to the same file. I would also recommend using compiled Macro Scheduler scripts.

The issue with cloning a virtual (or physical) machine is that they end up with the same security ID which could cause problems. But Microsoft have a program called NewSID which you can use. So with Virtual PC you can create a virtual machine, copy it, run it and run NewSID to create a clone of it. If you do this 25 times you should have 25 virtual machines you can run at the same time.
http://technet.microsoft.com/en-us/sysi ... 97418.aspx

Of course you need to consider the licensing implications of Windows and the software you are running within it.

I don't know about VMWare but it may be that VMWare server has some way of dealing with this. Oh, I see Gale has already answered that one.

So, there you go. Various options. Hope it helps.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

lebrocoli
Pro Scripter
Posts: 53
Joined: Tue Sep 06, 2005 9:28 pm

Post by lebrocoli » Wed May 13, 2009 4:53 pm

Thanks a lot for all your answers! This is great! I will have a look at all this.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts