Load testing tips and recommendations Follow
Many organisations like to load test to ensure that their site will stay online under a certain volume of users. This is a noble objective, however it is a dark art to make load testing somewhat resemble real user traffic.
There are a number of areas to consider when planning / structuring your load testing, especially with a global performance optimisation platform in place (section.io):
1) Most load testing tools do not actually load the full page
Most load testing tools only request the HTML document, this is good because HTML content generation / delivery is the most expensive thing you server infrastructure does - and is the best thing to cache in section.io - but the page load times you are getting via this method are only the HTML document delivery time NOT the full page load time.
If you see a load testing tool that uses a “headless” browser (such as PhantomJS) this means it is actually able to load the full page elements.
2) Structure your journeys to have a mix of users
Website traffic is a wide mix of user experiences. On an ecommerce website: Most browse homepage and a few other pages. Some may go to the category and product pages and add to cart, very few will go through checkout and complete purchase.
It’s essential to have all of these elements running at once to simulate an actual real site traffic experience.
Leverage your existing metrics and logs to understand your actual users traffic profile.
3) Decide on traffic ramp up profile
Many high traffic events ramp up gradually (for example an email marketing campaign will be sent over several hours).
Other events such as TV promotions often result in a spike of traffic in minutes or seconds after screening.
Understand your traffic profile and build your tests to simulate the desired ramp up approach.
4) Cache warming and cache clearing
Many load tests start with a cache clear of all CDN and content caches. This places immense strain on the origin and optimisation infrastructure that will not be present in a real user traffic spike as caches will be warm.
A common approach to get a consistent load test result is to:
- Clear caches
- Run a warm up set of requests to warm / fill caches so they approximate actual configuration
- Run load test with an appropriate ramp up period
Having a longer warm up period in your load tests enables caches to start to fill and get closer to an actual user experience.
5) Load testing agent counts and location
Its very common to run load tests from a single source agent and source IP. This is nothing like an actual user experience where there are thousands of different source IP’s.
We have seen performance and optimisation problems when load tests try to run hundreds of “users” from a single agent / source IP. This imbalance means that all traffic is not evenly spread over section.io nodes and can cause timeouts and errors that are not present in actual users traffic (It can also trip underlying platform security protections).
Pro Tip: Have your load testing script query DNS again (for your www.site.com.c.section.io CNAME record) for each page journey (or request) this will ensure that traffic is spread over Section infrastructure appropriately
Touch base with section.io support if you want additional help in the design and setup of load tests or keeping your site online under high traffic.
Article is closed for comments.