Skip to content

Commit b4b8fef

Browse files
committed
load test kurtosis guide improvements; added tps
1 parent 3ff24a9 commit b4b8fef

File tree

1 file changed

+60
-15
lines changed

1 file changed

+60
-15
lines changed

doc/load-testing-guide.md

Lines changed: 60 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,52 @@ Each scenario includes example commands and configuration tips to simulate reali
3535

3636
- [Kurtosis CLI](https://docs.kurtosis.com/) installed
3737
- [polycli](https://github.com/0xpolygon/polygon-cli?tab=readme-ov-file#install) installed and configured
38-
- Funded accounts with private keys available to `polycli`
38+
- Set `$private_key` with the private key of the funded account available to `polycli`
3939
- Access to performance monitoring tools (optional but recommended, e.g., `Grafana` + `Prometheus`)
4040

4141
## Configuring Kurtosis for Load Testing
4242

43-
Launch a Kurtosis environment with your desired stack (e.g., CDK-Erigon or OP-Geth), for this example we will use the [kurtosis-cdk](https://github.com/0xPolygon/kurtosis-cdk) repository:
43+
Launch a Kurtosis environment with your desired stack (e.g., `CDK-Erigon` or `OP-Geth`), for this example we will use
44+
the [kurtosis-cdk](https://github.com/0xPolygon/kurtosis-cdk) repository:
4445

46+
this command will start the latest version of the environment provided by the `kurtosis-cdk` repository
4547
````bash
4648
kurtosis run --enclave cdk github.com/0xPolygon/kurtosis-cdk
4749
````
4850

51+
if you want to ensure you will run either `cdk-erigon` or `op-geth`, ensure to set the parameter `deployment_stages.deploy_optimism_rollup` accordingly, `false` for `cdk-erigon` and `true` for `op-geth`.
52+
53+
````bash
54+
kurtosis run --enclave cdk github.com/0xPolygon/kurtosis-cdk '{"deployment_stages": {"deploy_optimism_rollup": false}}'
55+
````
56+
4957
After the whole environment is started, set the env var `$rpc_url` with the RPC endpoint URL that will be used by
5058
`polycli`.
5159

60+
for `op-geth`:
61+
```bash
62+
export rpc_url=$(kurtosis port print cdk op-el-1-op-geth-op-node-001 rpc)
63+
```
64+
65+
for `cdk-erigon`:
66+
```bash
67+
export rpc_url=$(kurtosis port print cdk cdk-erigon-rpc-001 rpc)
68+
```
69+
70+
Last, but not least, all the examples below will use the `$private_key` environment variable, ensure this env var
71+
contains the correct private key for the network your kurtosis environment is running.
72+
73+
for `op-geth`:
74+
```bash
75+
export private_key=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
76+
```
77+
78+
for `cdk-erigon`:
5279
```bash
53-
export $rpc_url=$(kurtosis port print cdk cdk-erigon-rpc-001 rpc)
80+
export private_key=0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625
5481
```
5582

83+
5684
## Running Load Tests with polycli
5785

5886
`polycli` comes with a built-in command called `loadtest`, check more details about this command with:
@@ -71,11 +99,11 @@ command.
7199
`200 to Fatal`, `300 to Error`, `400 to Warning`, `500 to Info`, `600 to Debug`, `700 to Trace`, the default is `500`.
72100
- `--requests`: defines the number of requests that will be sent to the network by each concurrent execution.
73101
- `--concurrency`: define the number of concurrent executions of the load test. For example, if `--requests` is set to
74-
`10`
75-
and `--concurrency` is set to `2`, then 2 load test executions will start concurrently and each concurrent execution
76-
will send 10 requests, making 20 requests in total.
102+
`10` and `--concurrency` is set to `2`, then 2 load test executions will start concurrently and each concurrent
103+
execution will send 10 requests, making 20 requests in total.
77104
- `--rate-limit`: defines the number of requests that can be sent per second to the network, this limits the requests
78-
sent across the concurrent executions
105+
sent across the concurrent executions. _If you want to check TPS, ensure to set this parameter manually accordingly to
106+
the environment max capacity because the default value is 4 txs per second._
79107

80108
Here is a template that you can use to start writing you own load tests using `polycli`:
81109

@@ -149,16 +177,33 @@ the proxy url.
149177

150178
## Example Benchmark Results
151179

152-
TBD
180+
The numbers below were obtained from the execution of the steps above with:
181+
182+
this machine:
183+
184+
```
185+
- MacBook Pro - 14" 2021
186+
- Chip Apple M1 Pro
187+
- 16GB Ram
188+
- macOS Sequoia 15.5
189+
```
190+
191+
these extra flags:
192+
193+
```
194+
--concurrency 20
195+
--requests 50
196+
--rate-limit 2000
197+
```
198+
199+
**Note**: These numbers are based on controlled testnet conditions and may vary depending on hardware, network conditions, and configuration.
153200

154201
| Scenario | CDK-Erigon | OP-Geth |
155202
|----------------------|------------|----------|
156-
| Native Transfers | ~000 TPS | ~000 TPS |
157-
| ERC20 Transfers | ~000 TPS | ~000 TPS |
158-
| NFT Mints (ERC721) | ~000 TPS | ~000 TPS |
159-
| Uniswap Swaps | ~000 TPS | ~000 TPS |
160-
161-
> **Note**: These numbers are based on controlled testnet conditions and may vary depending on hardware, network conditions, and configuration.
203+
| Native Transfers | ~182 TPS | ~181 TPS |
204+
| ERC20 Transfers | ~171 TPS | ~177 TPS |
205+
| NFT Mints (ERC721) | ~164 TPS | ~178 TPS |
206+
| Uniswap Swaps | ~119 TPS | ~160 TPS |
162207

163208
## Monitoring and Visualization (Optional)
164209

@@ -172,4 +217,4 @@ For more details, see the [`polycli` repository](https://github.com/0xPolygon/po
172217

173218
---
174219

175-
_Last updated: 02-JUN-2025_
220+
_Last updated: 03-JUN-2025_

0 commit comments

Comments
 (0)