Sign inSign up

prongbang/herpy

By prongbang

•Updated about 2 years ago

Herpy API Gateway written in Rust

Image
0

360

prongbang/herpy repository overview

⁠herpy

Stauts

Herpy API Gateway write in Rust

"Buy Me A Coffee"

⁠Install

  • Install with Homebrew
brew update
brew tap prongbang/homebrew-formulae
brew install herpy
  • Install with Cargo
cargo install herpy --git https://github.com/prongbang/herpy.git
  • Install with Docker
docker pull prongbang/herpy:latest

⁠Benchmark

  • MacBook Pro (14-inch, 2021)
  • Chip Apple M1 Pro
  • Memory 16 GB
rewrk -h http://127.0.0.1:8080/hello -t 12 -c 100 -d 60s
⁠Comparisons

Source⁠

NameLatency.AvgLatency.StdevLatency.MinLatency.MaxRequest.TotalRequest.Req/SecTransfer.TotalTransfer.Rate
Direct1.96ms1.51ms0.03ms39.83ms305363550894.22381.49 MB6.36 MB/Sec
Herpy3.03ms1.88ms0.11ms33.97ms197825332971.05186.77 MB3.11 MB/Sec
KrakenD3.90ms1.62ms0.06ms65.20ms153933425656.21344.99 MB5.75 MB/Sec

⁠Configuration

  • herpy.yaml
version: "1"
metadata:
  port: 8080
services:
  - endpoint: "/users"
    method: POST
    backends:
      - host: "https://httpbin.org"
        path: "/get"
        method: GET
  - endpoint: "/posts"
    method: POST
    backends:
      - host: "https://httpbin.org"
        path: "/post"
        method: POST

⁠Run

  • Native
herpy -c herpy.yaml
  • Docker
docker run \
    -p 8080:8080 \
    -v "./herpy.yaml:/etc/herpy/herpy.yaml" \
    --name herpy-api-gateway \
    prongbang/herpy:latest
  • Listen
2024-03-23T16:20:32.967967Z  INFO herpy::server: starting server on '0.0.0.0:8080' listen=0.0.0.0:8080

Tag summary

Content type

Image

Digest

sha256:339666ac9…

Size

45.3 MB

Last updated

about 2 years ago

docker pull prongbang/herpy