Skip to content

Latest commit

 

History

History
69 lines (51 loc) · 4.04 KB

Server AMI.md

File metadata and controls

69 lines (51 loc) · 4.04 KB

There is now a server AMI for WebPageTest for quickly spinning up a private instance.

When you launch the instance, make sure to allow HTTP traffic through your EC2 firewall configuration/security group. You should probably also check /home/ubuntu/.ssh/authorized_keys and make sure previous keys from when the instances were created are not carried forward.

Some of the features of the server AMI are:

  • Pre-configured with locations for all of the EC2 regions
  • Will automatically start and stop test agents in regions as necessary to run tests
    • Default config limits Agents to 1 instance at a time in each region
    • Test agents will be terminated if they have been running for close to an hourly increment (since they are billed hourly) and haven't had work in the last 15 minutes
  • Defaults to a headless instance requiring API keys and use through the API only
    • Can be overridden by specifying headless=0 in the user data configuration
  • Can archive tests to S3 if a bucket is configured and provided through user data
  • Automatically updates the server and test-agent code to the latest (hourly)
  • Any settings can be specified or overridden through user data when first launching your new instance
  • A default API key can be provided through user data which will be configured as a no-limit API key
    • Additional keys will need to be added manually to /var/www/webpagetest/www/settings/keys.ini

Known issues:

  • The lag time for starting new test agents can be as long as 10 minutes.
  • S3 archiving does not currently re-use the EC2 key used for starting test agents.

To use the AMI you need to provide an EC2 key and secret (at a minimum) through user data when the instance is started. Any other settings provided through user data will override existing settings in settings.ini when you start your instance the first time. After you have started your instance, user data will no longer change the settings (e.g. on stop and restart of your instance).

Be sure to remove your key and secret from the user data of your instance for security.

To change settings after launching your instance, ssh to the instance and manually edit the file:

  sudo vim /var/www/webpagetest/www/settings/settings.ini

then bounce nginx:

  sudo service nginx restart

note that agent creation is logged at:

  /var/www/webpagetest/www/ec2/log

Example user data:

ec2_key=AKIAJKP75OFSROV5GWEQ
ec2_secret=<secret for the key>
api_key=MyAPIKey
headless=0

The full list of settings that can be specified is in settings.ini.sample

EC2 test agent AMIs can be found here

Connect to a Windows Test Agent:

The password is: 2dialit