logo

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.

ComponentReplicas
Peatio24
Barong24
Rango12
Envoy8

Test A

API endpointNumber of connectionsRequests per secondNumber of replicas
/markets20004337.512824
/markets50004281.595724
/markets200002862.861924
/markets/tickers10008517.845824
/markets/tickers20009371.253824
/markets/tickers500012177.015324
/markets/tickers200008296.128524
/currencies20002711.745124
/currencies50002958.883224

Test B

API endpointNumber of connectionsRequests per secondNumber of replicas
/account/balances20004356.071124
/users/me20001939.876612

Test C

Rango Load Test 1

Rango Load Test 2

Rango Load Test 3