https://github.com/jkaninda/goma-gateway-vs-traefik
Performance Benchmark: Goma Gateway vs Traefik
https://github.com/jkaninda/goma-gateway-vs-traefik
Last synced: 3 months ago
JSON representation
Performance Benchmark: Goma Gateway vs Traefik
- Host: GitHub
- URL: https://github.com/jkaninda/goma-gateway-vs-traefik
- Owner: jkaninda
- Created: 2025-07-16T03:42:47.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-07-16T06:03:05.000Z (3 months ago)
- Last Synced: 2025-07-17T06:32:50.576Z (3 months ago)
- Size: 1.73 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ Performance Benchmark: Traefik vs Goma Gateway
This benchmark compares **Traefik** and **Goma Gateway** under identical load conditions using [`wrk`](https://github.com/wg/wrk), a modern HTTP benchmarking tool.
```bash
wrk -t8 -c500 -d60s http://localhost/api/books
```> **Test environment:** 8 threads, 500 concurrent connections, 60 seconds duration
---
## ๐ Summary
| **Metric** | **Traefik** | **Goma Gateway** |
| ----------------------- | ------------ | ---------------- |
| **Requests/sec** | ๐ข 29,278.35 | 23,108.16 |
| **Avg Latency** | 81.58 ms | ๐ข **71.92 ms** |
| **Latency StdDev** | 143.85 ms | ๐ข **120.47 ms** |
| **Max Latency** | ๐ข 1.54 s | 1.82 s |
| **Total Requests** | ๐ข 1,757,995 | 1,388,634 |
| **Timeouts** | 74 | ๐ข **18** |
| **Transfer/sec** | 6.42 MB | ๐ข **6.81 MB** |
| **Memory (Idle)** | \~76 MB | ๐ข **\~5 MB** |
| **Memory (Under Load)** | \~250 MB | ๐ข **\~50 MB** |---
## ๐ง Analysis
### โ Traefik Highlights
* High throughput: \~29K RPS and \~1.75M total requests.
### โ Goma Gateway Highlights
* 12% lower average latency and more consistent performance.
* 76% fewer timeouts under the same load.
* 5x smaller memory footprint
* Higher per-request transfer efficiency.---
## โ๏ธ Throughput vs Stability
| Feature | Traefik | Goma Gateway |
| ------------- | ------------- | ------------------ |
| ๐ฆ Throughput | ๐ข High | Moderate |
| โฑ๏ธ Latency | Moderate | ๐ข Lower |
| ๐ Stability | Higher jitter | ๐ข More consistent |
| โ Timeouts | Higher | ๐ข Fewer |
| ๐ง Memory | 76โ250 MB | ๐ข 5โ50 MB |## Screenshot

---
## ๐งช Reproducing the Test
### โ Requirements
* Docker
### ๐ ๏ธ Setup: `docker-compose`
Create a file named `compose.yaml`:
```yaml
services:
okapi-example:
image: jkaninda/okapi-example
container_name: okapi-example
labels:
- traefik.enable=true
- traefik.http.routers.okapi-example.rule=Host(`okapi-example.jkaninda.dev`) || Host(`localhost`)
- traefik.http.routers.okapi-example.entrypoints=web
- traefik.http.services.okapi-example.loadbalancer.server.port=8080
restart: always
ports:
- 8080:8080
networks:
- defaultgateway:
image: jkaninda/goma-gateway:0.3.3
container_name: gateway
command: server
restart: always
volumes:
- ./goma.yml:/etc/goma/goma.yml:ro
ports:
- 80:80
- 443:443
networks:
- defaulttraefik:
image: traefik:v3.3.4
container_name: traefik
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./traefik.yml:/traefik.yml:ro
ports:
- 80:80
- 443:443
networks:
- default
```---
### ๐ง Configuration Files
#### `goma.yml` (Goma Gateway)
```yaml
gateway:
log:
level: error
entryPoints:
web:
address: ":80"
webSecure:
address: ":443"
networking:
transport:
insecureSkipVerify: true
routes:
- name: okapi-example
path: /
hosts:
- localhost
target: http://okapi-example:8080
```#### `traefik.yml` (Traefik)
```yaml
log:
level: ERRORproviders:
docker:
exposedByDefault: falseapi:
dashboard: true # Disable if not needed
insecure: true
entryPoints:
web:
address: ":80"
websecure:
address: ":443"serversTransport:
insecureSkipVerify: true
```---
## ๐ฆ Running the Tests
### ๐ข Goma Gateway
Start the gateway and backend:
```sh
docker compose up -d gateway okapi-example
```Check readiness:
```sh
curl http://localhost/api/books
```Run the performance test:
```sh
echo "GOMA GATEWAY"
wrk -t8 -c500 -d60s http://localhost/api/books
```---
### ๐ Switch to Traefik
Stop Goma Gateway:
```sh
docker stop gateway okapi-example && docker rm gateway okapi-example
```Start Traefik and backend:
```sh
docker compose up -d traefik okapi-example --force-recreate
```Check readiness:
```sh
curl http://localhost/api/books
```Run the test:
```sh
echo "TRAEFIK"
wrk -t8 -c500 -d60s http://localhost/api/books
```> ๐ก You can substitute `okapi-example` with any backend to run your own tests.
### Clean
```sh
docker compose down
```
---## ๐ Useful Links
* ๐ง **Goma Gateway**: [github.com/jkaninda/goma-gateway](https://github.com/jkaninda/goma-gateway)
* ๐ **Okapi Example**: [github.com/jkaninda/okapi-example](https://github.com/jkaninda/okapi-example)