Platform Load Testing Guide

Prerequisites

To have better insight into platform metrics, deploying Prometheus and Grafana beforehand is recommended.

Test Suite

Every test case contains the recommended tool and a list of endpoints to benchmark and metrics to collect.

Test A: Benchmark public API as guest

Test A diagram

Suggested tool: Hey Number of clients: 1 x 20,000 request per second Example: hey -c 20000 -n 150000 http://envoy.example-namespace:10000/api/v2/peatio/public/markets Metrics to collect: Number of requests per second, CPU load chart, Latency per page chart

Endpoints
http://envoy.example-namespace:10000/api/v2/peatio/public/markets
http://envoy.example-namespace:10000/api/v2/peatio/public/markets/tickers
http://envoy.example-namespace:10000/api/v2/peatio/public/currencies
http://envoy.example-namespace:10000/api/v2/barong/resource/users/me
http://envoy.example-namespace:10000/api/v2/peatio/public/trading_fees
http://envoy.example-namespace:10000/api/v2/peatio/public/markets/btckrw/trades

Test B: Directly benchmark API as a user

Test B diagram

Suggested tool: Locust with 20 workers Number of clients: 20 x 1,000 request per second Metrics to collect: Number of requests per second, CPU load chart, Latency per page chart

Endpoints
http://peatio-rails.example-namespace:8080/api/v2/peatio/account/balances
http://barong.example-namespace:8080/api/v2/resource/users/me

Test C: Open 20,000 connections on Rango

Test C diagram

Suggested tool: Artillery with 3 workers Number of clients: 20,000 WebSocket client subscriptions Metrics to collect: Memory heap chart, CPU load chart

Endpoints
ws://rango.example-namespace:8080?stream=global.tickers

Reference Results

You can find reference results for all the aforementioned load tests below.

Setup

All the tests were executed on a Kubernetes cluster of 12 nodes with 8 CPU cores and 16 GB of RAM each.

Component Replicas
Peatio 24
Barong 24
Rango 12
Envoy 8

Test A

API endpoint Number of connections Requests per second Number of replicas
/markets 2000 4337.5128 24
/markets 5000 4281.5957 24
/markets 20000 2862.8619 24
/markets/tickers 1000 8517.8458 24
/markets/tickers 2000 9371.2538 24
/markets/tickers 5000 12177.0153 24
/markets/tickers 20000 8296.1285 24
/currencies 2000 2711.7451 24
/currencies 5000 2958.8832 24

Test B

API endpoint Number of connections Requests per second Number of replicas
/account/balances 2000 4356.0711 24
/users/me 2000 1939.8766 12

Test C

Rango Load Test 1

Rango Load Test 2

Rango Load Test 3