https://github.com/marco-rosner/lightweight-go-server
A performance comparison to find the lightweight go server between Echo, Gin and Fiber servers
https://github.com/marco-rosner/lightweight-go-server
benchmark echo echo-framework fiber fiber-framework gin go golang lightweight server
Last synced: 2 months ago
JSON representation
A performance comparison to find the lightweight go server between Echo, Gin and Fiber servers
- Host: GitHub
- URL: https://github.com/marco-rosner/lightweight-go-server
- Owner: marco-rosner
- License: mit
- Created: 2023-08-16T14:58:56.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-23T16:30:32.000Z (over 2 years ago)
- Last Synced: 2025-05-30T11:54:18.734Z (about 1 year ago)
- Topics: benchmark, echo, echo-framework, fiber, fiber-framework, gin, go, golang, lightweight, server
- Language: Go
- Homepage:
- Size: 35.5 MB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://opensource.org/licenses/MIT) [](https://github.com/marco-rosner/genDocsGPT)
## Lightweight Go Server
A performance comparison to find the lightweight Go server using Echo, Gin and Fiber servers. We will use MongoDB and Postgres as database and Docker compose as container enviorement. We will use some of the rules from [Rinha de beckend](https://github.com/zanfranceschi/rinha-de-backend-2023-q3) to get the results.
## Run server
You should go to the server folder that you would like to use, set the env var for the choosen database and run the server. Like:
```sh
cd echo && DB="mongo" MONGODB_URI="..." go run .
```
## Run with Docker compose
Make sure that you have [docker](https://docs.docker.com/get-docker/) and [docker compose](https://docs.docker.com/compose/install/) installed. Next, you should choose which server and database you would like to run (e.g. docker-compose--.yml) and run the command like this:
```sh
docker-compose -f docker-compose-echo-postgres.yml up --remove-orphans
```
## Run benchmark
I am using Gatling to run the benchmark and to install it go to benchmark folder and run the `install-gatling` script. After that, move the `BenchmarkSimulation.scala` file to `deps/gatling/user-files/simulations` and the resources `pessoas-payloads.tsv` and `termos-busca.tsv` to `deps/gatling/user-files/recources`.
Go to the command line and run:
```sh
sh deps/gatling/bin/gatling.sh
```
## Last results
Using Postgres:

Echo

Fiber

Gin
Using MongoDB:

Echo

Fiber

Gin