Load Testing with Vegeta

The Big Jump

We had one of those good news/bad news situations at work recently: we learned that we’d be signing a major media site that will end up bringing us something like a 50% increase in traffic (awesome news!) and that they’d start sending us traffic as soon as this week (scary!).

In an ideal world, we’d throttle the traffic from this new site and slowly ramp up, allowing us to see how our system performs under the additional load. We use AWS autoscaling for our api servers, so we have some flexibility, but there are some underlying aspects that don’t scale — we have a fixed number of MySQL instances, for example, and our log rolling has always been a pain point so there’s no guarantees whether it will scale gracefully.

The issue is that the traffic comes from a 3rd party JavaScript library, and there’s not really a graceful way to make a throttling decision on the client side (at least not one that gives us an easy ability to change the throttling rate). The best we could do is implement a request filter that quickly looks up the throttling rate of the site the request is from (there’s some caching involved, but I’m already on a bit of a tangent) and then ‘short circuits’ the request so to speak and sends back a jsonp response that disables our JavaScript.

Ultimately, this means that even in the best case, we’re going to see a 50% jump in initial calls, even if those calls immediately return a disable response. So that means we needed a load testing solution!

Continue reading Load Testing with Vegeta