The Right Tool For The Job?

In my last post I started working on an API for our system. In that post I exposed the wonders of Grape and the tooling around getting it started. After working with Grape for a little bit and getting things more in order, I started getting better defined requirements for the API and one of them stood out. We needed to be concerned with the amount of requests that we could process. This made me start thinking about the scalability and load we would be putting the API under. I looked online and found speed comparisons and benchmarks, and while they made me feel more confident in my choice I still wanted some more data.

Maybe This Will Help

As luck would have it I stumbled upon a tool that might help. That tool was goad. I won’t go into the details of the tool itself, you can check out the website if you want that. I do want to explain how I used it to give me more confidence about the API I was working on and its performance.

Install and Test Maybe?

The install is pretty simple: download the binary from the site and it should run. Unfortunately, I was testing an internal protected API, so I couldn’t just fire it off at the server and get my results. First, I had to remove the protection from the API call itself (we are using JWT). Then I had to open the server up to HTTP traffic from the world (only during testing). After that it was time to test. Well, at least I thought it was and it did work, but it was running in the wrong account (we have separate account for different functions). A quick look at github issues shows I’m not the first person to have this issue and luckily there is a pretty easy fix. Just install awsenv-profiles.

The Results

So at the end of all of this I was able to get some numbers. The server I was running handled about 500 connections, serving about 7-8 requests per second. Those numbers don’t sound great on the surface but let’s put some perspective on that. This is an Amazon t2.small that’s running both the API and the database. Now granted, things will slow down a little if I add a network connection for the database, but I also will take a significant load of the web server. I have done no optimizations, tweaking or performance enhancements, this is just first-pass rough code, so all in all I was pretty happy. Is this the end-all-be-all of our load testing? I’m sure it’s not, but for the type of sanity check testing I needed at this time, Goad was great.

Thanks to the Goad team for putting it out there.