Using the ready-made WPT AMI (https://github.com/WPO-Foundation/webpagetest/blob/master/docs/EC2/Server%20AMI.md), is there a way to use EC2 reserved instances for test agents? With a lot of testing to do this is likely to be more economic (and get results quicker) spinning up on-demand EC2 instances.
I guess if there was a means to spin up a reserved instance so that WPT server recognised it and then disable the termination of agents that would do the trick…
Not yet but the server image support is still pretty new so it’s good to know the use case. I was planning a few things that would help:
- Allow for specifying the default location through user data
- Have a setting that always keeps a minimum of X test agents for the default location (or possibly a way to specify a minimum and maximum number for every location)
As far as I can tell, there’s no special API for separating on-demand and reserved instances. I assume spinning up on-demand instances of a given size will pull from your reserved instances first and then go into regular on-demand (unless you were using reserved instances to refer to always running rather than Amazon’s special pricing).
It might also be worthwhile to see about custom schedules where a hot spare is kept around during the week during the day but shut down over night or on weekends though figuring out how to expose that as a config is going to be a bit of a challenge.
Your suggestions for setting default location and keeping a min of test agents running look good to me.
Of course, you are right about reserved instances - its a question of pricing, no more.
With that in mind, if it was possible to set a min number of 'agents, my use case would be fulfilled.
Custom schedules would be nice, but perhaps not essential (since you could probably achieve the same thing with external tools/scripts to spin up/down). As to config, wouldn’t a CRON-like syntax do the job?
Cron syntax is good for when to kick off an event but it’s not great for blocking off durations in time. (M-F 8-5 for example).