Objective: Measure performance of Ethereum node(s) under load by simulating JSON-RPC API traffic using OctoPerf and track system metrics via Grafana and InfluxDB.

🔧 PART 1: Environment Setup

1. Set Up Ethereum Node(s) in Docker

We'll use Geth for this example:

docker run -d --name geth-node \
 -p 8545:8545 \
 -v $HOME/.ethereum:/root/.ethereum \
 ethereum/client-go \
 --http --http.addr "0.0.0.0" --http.api "eth,net,web3" --http.corsdomain "*" --syncmode "fast"

💡 Use multiple nodes and expose JSON-RPC interfaces if testing cluster performance.

2. Set Up InfluxDB for Metrics Storage

docker run -d --name=influxdb \
 -p 8086:8086 \
 -v influxdb:/var/lib/influxdb \
 influxdb:1.8

Create a database for metrics:

docker exec -it influxdb influx
> CREATE DATABASE eth_metrics;
> exit

3. Set Up Grafana

docker run -d --name=grafana \
 -p 3000:3000 \
 --link influxdb \
 grafana/grafana

  • Access Grafana: http://localhost:3000 (default login: admin/admin)
  • Add InfluxDB as a data source (URL: http://influxdb:8086, Database: eth_metrics)

📈 PART 2: Enable System Metrics Collection

Install Telegraf or Docker Stats Exporter to collect metrics and push to InfluxDB:

Option A: Telegraf (Host Monitoring)

docker run -d --name=telegraf \
 --net=host \
 -v /proc:/host/proc:ro \
 -v /sys:/host/sys:ro \
 -v /etc:/host/etc:ro \
 -e HOST_PROC=/host/proc \
 -e HOST_SYS=/host/sys \
 -e HOST_ETC=/host/etc \
 telegraf \
 --config-directory /etc/telegraf/telegraf.d

Configure telegraf.conf to send to InfluxDB:

toml

[[outputs.influxdb]]
 urls = ["http://localhost:8086"]
 database = "eth_metrics"

🚀 PART 3: Configure OctoPerf for Load Testing

1. Create an OctoPerf Account

2. Build the Test Plan

  1. Create a New Project
  2. Create a Virtual User
    • Choose "HTTP Request"
    • Set method to POST
    • URL: http://<host>:8545
    • Body:
    • jsonCopyEdit
      {  "jsonrpc":"2.0",  "method":"eth_blockNumber",  "params":[],  "id":1}
    • Header: Content-Type: application/json
  3. Add Validation (Optional)
    • Add assertions to check response contains "result" or valid block number.
  4. Add Think Time (Optional)
    • Simulate realistic load using pacing or think-time.
  5. Parameterization (Optional)
    • Load addresses or methods dynamically for varied testing.

3. Run the Test

  • Choose number of users (threads), ramp-up, and duration.
  • Deploy from a cloud location or from your local agent (Docker agent available).
  • Start test and collect metrics: latency, throughput, errors, etc.

📊 PART 4: Real-Time Monitoring with Grafana

Suggested Dashboards

  • Node Health Dashboard: CPU, memory, disk, network I/O
  • RPC Performance Dashboard:
    • InfluxDB queries for HTTP request metrics (via Telegraf or custom exporters)
  • Custom RPC Metrics (Advanced):
    • Use Prometheus exporters (e.g., eth-exporter or custom scripts)

Example InfluxDB query (for Grafana panel):

sql

SELECT mean("usage_cpu") FROM "cpu" WHERE $timeFilter GROUP BY time($__interval), "host"

🧼 PART 5: Post-Test Analysis

From OctoPerf

  • Analyze:
    • Response time percentiles
    • Error rates
    • Throughput trends
  • Export reports as PDF/CSV.

From Grafana

  • Review system utilization trends correlated with test phases
  • Check for:
    • CPU saturation
    • Memory leaks (JVM for Besu)
    • Network congestion
    • Disk I/O spikes (if syncing)

🛠️ Troubleshooting Tips

SymptomCauseFix500 Errors in OctoPerfRate-limited RPC callsIncrease node resources or rate-limit trafficGrafana shows no dataTelegraf misconfiguredCheck output section of telegraf.confLow throughputNode not syncedEnsure Geth/Besu is fully syncedTest fails quicklyDocker bridge issuesCheck Docker network mode and firewall rules

🧪 Optional Enhancements

  • Add Prometheus & eth-exporter for Ethereum-specific metrics.
  • Deploy a Geth private network for full control of blockchain state.
  • Use k6 or JMeter for additional comparison with OctoPerf.
  • Automate test cycles via CI/CD pipelines (e.g., Jenkins or GitHub Actions).

Articles

Connect with a Webflow Expert to create a website using this template.Learn More

Hireus Close Image