Approaches to stress testing ODK servers

Here's how I've stress tested ODK Aggregate in the past. If you have other ways to do stress-tests, please share!

  1. In Aggregate, upload your sample form (form.xml). Make sure anonymousUser has Data Collector privileges.

    form.xml (601 Bytes)

  2. Install Apache Bench on a machine where the phones will be (basically outside of your network). Apache Bench comes with Apache HTTP server.

    • macOS: It's already installed :rocket:
    • Ubuntu: sudo apt-get install apache2-utils
    • Windows: Use Apache Friends
  3. Run the following command to upload a submission (post-file.txt). If you are using Windows, it'll be ab.exe not ab.

    post-file.txt (232 Bytes)

    • Upload a single submission to a local Tomcat server
      ab -l -p post-file.txt -T "multipart/form-data; boundary=1234567890" http://your_server_ip:your_port/ODKAggregate/submission

    • Upload 100 submissions with 100 concurrent requests to an remote App Engine server
      ab -n 100 -c 100 -l -p post-file.txt -T "multipart/form-data; boundary=1234567890"

  4. In the results, look for Non-2xx responses (the number of failed submissions) and Requests per second (the throughput). You want few failures and lots of throughput!


-n 100 -c 100 is a bit of an odd case that won't test steady-state throughput and JVM longterm stability (OOM, XMX, GCdeath, etc); I'd recommend tuning to something more like -n 5000 -c 60 to let it run for longer and with a more realistic concurrency. Or do both!

1 Like