A tool to benchmark Ethereum Virtual Machine (EVM) compatible RPC endpoints, with optional proxy support. This script provides insights into the performance of RPC nodes by measuring response times and success rates.
- Benchmarking: Measure response times, success rates, and requests per second (RPS) for EVM RPC endpoints.
- Proxy Support: Option to benchmark RPC endpoints through proxies.
- Asynchronous: Uses
asynciofor concurrent requests to ensure efficient benchmarking. - Simple CLI Interface: Choose between benchmarking with or without proxies.
- Output: Results are stored in JSON format and displayed in a tabulated form in the console.
- Python 3.7+
aiohttpfor asynchronous HTTP requeststabulatefor pretty printing the resultstermcolorfor colored console outputcoloramafor cross-platform colored terminal text
Install the required packages using:
pip install aiohttp tabulate termcolor coloramarpc.txt: Contains URLs of RPC endpoints, one per line.proxy.txt(optional): Contains proxy servers, one per line.
python3 benchmark.py- For RPC Benchmark without proxy
- For RPC Benchmark with proxy
Results are saved in results.json. A summary table appears in the console with color-coded data for easy reading.
https://mainnet.infura.io/v3/YOUR_PROJECT_ID
https://eth-mainnet.alchemyapi.io/v2/YOUR_API_KEY
login:password@ip:port
- RPC URL: The endpoint being tested.
- Proxy: Indicates if a proxy was used (yellow if yes, black if no).
- Avg Response Time: Average response time in milliseconds. Green if below 100ms, red otherwise.
- Min/Max Response Time: Best and worst-case response times.
- Successful Responses: Number of successful requests.
- Error Responses: Number of failed requests.
- RPS: Requests per second within a defined response time threshold (
MAX_RESPONSE_TIME = 1000ms).
- Adjust
MAX_RESPONSE_TIMEin the script to define what counts towards the RPS calculation. - The script uses a specific Ethereum call to benchmark, which can be modified for different use cases.
0xFillin
- Twitter: @0xFillin
- GitHub: 0xFillin/evm-rpc-benchmark
This project is licensed under the MIT License. See the LICENSE file for more details.
Happy benchmarking!