/overload

A distributed load testing tool written in Rust

Primary LanguageRustMIT LicenseMIT

overload

Github Pages Rust MIT licensed Github

Overload is a distributed, scalable performance testing application. It mainly focuses on ease-of-use.

  • Distributed - users don't need to handle complex cluster management - the application creates and manages the cluster by itself once deployed.
  • Control - better control over QPS, connection pool, request data
  • Assertion - easy assertion with lua script

For details usage and reference please check https://eipi1.github.io/overload/

Getting started

Docker

docker run -p 3030:3030 ghcr.io/eipi1/overload:latest-standalone-snapshot

Kubernetes

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: overload
  name: overload
  namespace: default
spec:
  replicas: 4
  selector:
    matchLabels:
      app: overload
  template:
    metadata:
      labels:
        app: overload
    spec:
      containers:
        - image: ghcr.io/eipi1/overload:latest-cluster-snapshot
          imagePullPolicy: "IfNotPresent"
          name: overload
          ports:
            - containerPort: 3030
            - containerPort: 3031
          env:
            - name: DATA_DIR
              value: "/tmp"
            - name: RUST_BACKTRACE
              value: "1"
            - name: K8S_ENDPOINT_NAME
              value: "overload"
            - name: K8S_NAMESPACE_NAME
              value: "default"
            - name: RUST_LOG
              value: info

---
apiVersion: v1
kind: Service
metadata:
  name: overload
spec:
  #  type: LoadBalancer
  selector:
    app: overload
  ports:
    - protocol: TCP
      port: 3030
      targetPort: 3030
      name: http-endpoint
    - protocol: TCP
      port: 3031
      targetPort: 3031
      name: tcp-remoc

---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: overload-endpoints-reader
rules:
  - apiGroups: [""]
    resources: ["endpoints"]
    verbs: ["get", "list"]

---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: overload-endpoints-reader
subjects:
  - kind: Group
    name: system:serviceaccounts
    apiGroup: rbac.authorization.k8s.io
roleRef:
  kind: Role
  name: overload-endpoints-reader
  apiGroup: rbac.authorization.k8s.io

Start Test

The following request will send two GET request per second("countPerSec": 2) to httpbin.org/get for 120 seconds("duration": 120). More example can be found in test cases

curl --location --request POST '{overload-host}:3030/test' \
--header 'Content-Type: application/json' \
--data-raw '<json_request_body>'

Sample JSON request body -

{
  "duration": 120,
  "name": "demo-test",
  "qps": {
    "ConstantRate": {
      "countPerSec": 2
    }
  },
  "req": {
    "RequestList": {
      "data": [
        {
          "method": "GET",
          "url": "/get"
        }
      ]
    }
  },
  "target": {
    "host": "httpbin.org",
    "port": 80,
    "protocol": "HTTP"
  }
}

It'll respond with a job identifier and status.

{
  "job_id": "demo-test-d2ae5ff0-7bf4-4daf-8784-83b642d7dd6b",
  "status": "Starting"
}

We'll need the job_id if we want to stop the test later.

Get job status

curl --location --request GET '{overload-host}:3030/test/status/'

Stop a job

curl --location --request GET '{overload-host}:3030/test/stop/demo-test-d2ae5ff0-7bf4-4daf-8784-83b642d7dd6b'

Monitoring

Overload exposes details data on QPS, assertion result, etc through prometheus. For details please check here

License: MIT