Stress Testing APIs

Anyone know of a good way to stress test an HTTP API?

By this I mean create X predefined requests a second, or something like that.

I need to test 3 things -

  1. can Anvil handle what I’m going to throw at it (on their hosted servers),
  2. how much AWS HTTP API married with AWS Lambda will cost for the same,
  3. whether my Heroku instance will explode or not.

Only way to find out is try it, but I can’t put live traffic there, I’ve got to simulate it first.

Happy to pay for the software, but I don’t want to develop anything. Got WAY too much on my plate as it is.

edit - maybe stress testing is the wrong terminology. I want to load test. I know what the maximum load will be, I just need to see which system can take it and still cost in (I hope it’s Anvil!).

The API will be doing DB lookups, Redis lookups and inserts on both. So I imagine there will be a high degree of concurrency…

Loader.io (up to about 1 million requests per minute with free account) is my choice for this kind of test but unfortunately, it doesn’t work with anvil since a file has to be placed on root folder which is not possible with anvil app (asset folder only)

I end up writing my own app to do stress test

I’m not looking to measure anything apart from whether the target implodes (or charges me $squillion).

The API might (hopefully not, but might) take 2 or more seconds to complete, so when called many times a second there will be like a wave of simultaneous calls in progress, peaking at I-don’t-know-what.

I don’t know where the limits of Anvil are, or what financial impact that might have if I run this on AWS or Heroku, so i need to try it.

1 Like

I’m also quite curious about your number 1.

I am not too sure my method helps, it is my 2 cents.

In order to measure the capacity of Anvil hosted app, I create a timer in the client that sends add request to server every second, then count how many added row are made during 2 minutes.

Opening 10 or 20 tabs at the same time would definitely causes the app really slow. Adding a row takes more than 5 seconds comparing to opening only 2 tabs, which is about 1 secs.

I also test the same app with the open source server, the stronger my server, the more clients/tabs the app can handle. This configuration ( 24 CPU 96 GB RAM) can handle more than 100 tabs or more at the same time. The minimum one (1 CPU 512 MB RAM) can barely take care of 10 tabs.

This is just Vertical scale, if I can find a way to make the open source app server connect to a remote database, Horizontal scale scaling anvil app would be possible.