How can I automatically start a program on Amazon's EC2 Windows 2008 web servers?

For example, if I wanted to test the "Digg effect" on a web page of mine, how could I open 100 windows 2008 servers at once, each loading one (or two?) instances of the firefox web browser?

I have placed a sample batch file in the windows startup folder that echos the time it was called, but it is only started when I actually login remotely via the remote desktop protocol.

I don't want to have to login to 100 servers to get my software to run :P What can I do?

I am using this Windows 2008 Datacenter, Amazon-supplied AMI specifically: ami-a2698bcb

link|improve this question

feedback

3 Answers

up vote 1 down vote accepted

How can I automatically start a program on Amazon's EC2 Windows 2008 web servers?

Just run it as a service. Follow this tutorial:

http://www.hosting.com/support/vps/windows/service/

M

link|improve this answer
Marius, you da man!! Is there any super simple way to accomplish this on linux as well, do you know??? Their virtual linux boxes are almost half the price! – darkAsPitch Feb 10 '10 at 19:40
feedback

On Linux use wget instead of firefox and write a small script like this:

#!/bin/bash
# Script name: myscript.sh
case $1 in
start)
   for ((i=0; i<=100; i++))
   do
   wget -q -O - http://www.yoursite.com
   sleep 1
   done
;;
esac

make it executable, copy it into the /etc/init.d directory, make a symlink to it in your default runlevel init directory (/etc/rc2.d for Debian &co, /etc/rc5.d for other distros) and name the link S99myscript.

Now everytime your instance boot, it will send 100 http requests to your site (1 per second).

M

link|improve this answer
feedback

I use WinServ (http://www.sw4me.com/wiki/Winserv) instead of the resource kit, since there could be issues with the 2k3 resource kit on 2k8. Plus WinServ will let you use a batch file for your service, etc.. And its free.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.