Selenium Grid Spot Instance Nodes
Your selenium grid can use spot instance nodes (our most popular option) which will give you lots more test time at a substantial reduction in cost because of Amazon discounts. The difference between an on-demand and a spot instance is that spot instances do not launch immediately and it usually takes an additional 15-30 seconds before a spot node start processing your tests requests.
There is also no guarantee that a spot request will be fulfilled as unlike with an On-Demand instance which has a fixed price, the spot price varies with time and could sometimes peak above the current On-Demand price or the spot bid price. There is also a risk that an already running spot instance is terminated by Amazon if the spot price peaks or there is a change in capacity allocation.
Our approach to these conditions has proven to be very effective and gives you access to steep discounts that you can count on over long periods of time. This is what we do to reliably provide spot selenium grid nodes when requested:
If your tests are less then 2 minutes in time you never have to worry about using spot nodes thanks to the 2 minute spot termination warning that Amazon gives before pulling a spot instance. We check this condition every 5 seconds and if present will take the node offline without disrupting any running tests. We actually do not terminate the node instance but leaves it to Amazon to do so which results in a no charge for you for that part hour!
We constantly monitor the current spot price in all EC2 Availability Zones and depending on the current spot price, spot request fulfill rate and fulfill time, spot price trend and the risk for a price peak, real time events (one of our spot instances pulled by Amazon) or changes in capacity allocation, our auto scaling service makes a decision to launch a Spot or an On-Demand instance, and in what availability zone for optimal reliability and performance.
Since our spot strategy algorithms adjusts automatically and in real time based on the collective usage of spot nodes by all our customers we can achieve a much higher degree of reliability and lower cost than you typically could ever hope to achieve by yourself.
Your selenium grid nodes uses AWS VM sizes that very rarely have any price peaks effecting all availability zones in the region at the same time. You can check for yourself how often they occur in the last 3 months if you have an Amazon AWS account, go to Amazon EC2 Management Console, spot request section - price history. You can also easily change your grid node size for your selenium grid in order to find the optimal size for your type of testing and budget.
Our spot bidding strategy includes bidding a higher price than the current spot price to allow for price movements without spot instances being terminated prematurely. We will never bid higher than the current on-demand price. The maximum you can be charged for a spot instance is the on-demand price.
When you configure your selenium grid to use spot instances you can also specify how many minutes you want to wait for an spot request to be fulfilled. If the wait time is exceeded the spot request is canceled and replaced automatically with an On-Demand instance.
The selenium grid health is constantly monitored and if a spot instance is pulled by Amazon the corresponding grid node will be immediately de-registered from your selenium grid within seconds to prevent a test being routed to this node.
Also consider that your nodes run for a very short time before they are re-cycled and that a node is only effected if it happens to process a test at the given time.
If Amazon terminates a grid node because of a spot price increase beyond the on-demand price, Gridlastic will not charge for that part hour and you can see in your reports how many, if any, grid nodes that was terminated this way.
When you configure your selenium grid you have the option to use only On-Demand nodes for your auto scaling.