Categorygithub.com/lucdoe/opengateway
module
0.0.0-20240807101716-1e8093203135
Repository: https://github.com/lucdoe/opengateway.git
Documentation: pkg.go.dev

# README

OpenGateway - lightweight API Gateway

codecov Go Report Card License Build

Welcome to the OpenGateway repo, an lightweight API Gateway written in Go for small to mid-sized projects. Leveraging Go's performance and simplicity, this gateway ensures quick response times and reliable performance without the complexity of larger systems. It is open-source, avoiding vendor lock-in and allowing complete control over deployment and customization through simple YAMl config.

You can easily extend its functionality with configurable plugins, and the setup is straightforward, with minimal configuration needed.

Please also see the architecture diagrams for an overview and better understanding of the architecture.

Local setup

  1. Clone the repository:
    SSH: git clone [email protected]:lucdoe/opengateway.git
    HTTPS: git clone https://github.com/lucdoe/opengateway.git

Docker

Make sure you have Docker with Docker Compose installed on your machine. Docker recommends Docker Desktop for Windows and Mac users.

  1. Edit the cmd/gateway/config.yaml file to your needs
  2. Run Docker compose with docker compose up

Manual

  1. Edit the cmd/gateway/config.yaml file to your needs
  2. Run the gateway with go run cmd/gateway/main.go

Metrics

Benchmark Results

We conducted a performance benchmark using hey with the following parameters:

  • Total Requests: 50,000
  • Concurrency Level: 130

Summary

  • Total Time: 5.9502 seconds
  • Requests per Second: 8,389.5769
  • Slowest Request: 0.1654 seconds
  • Average Request Time: 0.0147 seconds
  • Total Data Transferred: 63,811,840 bytes
  • Size per Request: 1,278 bytes

Status Code Distribution

  • 200 OK: 49,853 responses

Load testing (Locust)

We have conducted load testing on our API Gateway using Locust (200 peaks, 50 ramps, 5m).

TypeNameRequestsFailsMedian (ms)Average (ms)Min (ms)Max (ms)Average size (bytes)Current RPSCurrent Failures/s
GET/some-endpoint15,532044.931761,28066.80

The gateway performs well under the tested load, with no failures and consistent response times.

These results clearly show the API Gateway's performance under load, highlighting its ability to handle many requests efficiently.

License

The code of this repository is licensed under Apache v2.0. Read License tldr for a quick summary.

# Packages

No description provided by the author