This project was inspired by Mihai Cracan's article Web REST API Benchmark on a Real Life Application. I was curious how Golang compare to other languages in terms of performance.
- .NET core
- Golang mux
- Java Spring
- PHP Laravel
- Node express
- Python Django
Each app exposes the same 4 endpoints with different complexity:
- Hello World - simply respond with {"hello": "world"}.
- Computation - Compute first 10 000 Fibonacci numbers and respond with {"status": "done"}.
- Simple Listing - List all records from countries table.
- Complex Listing - List all users who visited France alongside with all visited countries. Users has many to many relationship with countries.
Benchmark was run on Google Cloud Platform n1-standard-4 instance with 4 vCPUs and 15GB RAM All apps and MySQL database was running simultaneously in Docker containers bootstrapped with docker-compose.yml Apache Benchmark was run on separate instance.
This repo contains several bash scripts to run benchmark. Scripts was tested on Ununtu 18.04 LTS.
- Clone this repository.
- Run
./up.sh
- This script will install docker, start mysql database, restore database dump fromdatabase.sql
file, start all applications and run newman tests to ensure that everything is up and running. - Run
./ab.sh hostname
- This script will run Apache Benchmark againsthostname
and save results todata
directory - To generate charts you need to have gnuplot installed and run
gnuplot timeseries.plt; gnuplot rps.plt
charts will be saved tographs
directory.