Blockchain Performance

Production engineering guide for blockchain performance in Web3 and blockchain systems.

Blockchain Performance is the engineering discipline of measuring, diagnosing, and optimising the throughput, latency, and resource efficiency of blockchain networks and applications. It matters when transactions are slow, gas fees are high, users complain about confirmation delays, or when a smart contract fails under load—especially in production systems where delays are costly and predictable. This page details how to assess, tune, and maintain performance across the entire blockchain stack, from node operation to application deployment, using real tools and real workflows.

Measuring Latency and Throughput

To evaluate blockchain performance, start with end-to-end latency and transaction throughput. Use curl to query a node’s RPC endpoint, and jq to extract key metrics.

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "eth_getBlockByNumber",
    "params": ["latest", true]
  }' \
  http://localhost:8545 \
  | jq '.result | { number, hash, timestamp, transactionCount, gasLimit, gasUsed }'

The response includes timestamp in Unix seconds, transactionCount as a decimal number, and gasLimit and gasUsed as hex-encoded integers. The time between sending the request and receiving the response gives round-trip latency to the node. Use time to capture this:

time curl -s -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_getBlockByNumber","params":["latest",true]}' \
  http://localhost:8545 \
  | jq '.result.timestamp'

High timestamp values indicate a lagging node; transactionCount discrepancies between blocks suggest batching or delayed finality.

For sustained throughput, generate 1,000 transactions using a script and measure time-to-finality. A minimal test:

#!/bin/bash


for i in {1..1000}; do
  curl -s -X POST \
    -H "Content-Type: application/json" \
    -d '{
      "jsonrpc": "2.0",
      "id": '"$i"',
      "method": "eth_sendTransaction",
      "params": [
        {
          "from": "0x742d35Cc6634C0532925a3b8D4C05C6E6C3C8396",
          "to": "0x88a2a15517493b9d4e3f2103c7c0d30b3a23561e",
          "value": "0x123456789abcde",
          "gas": "0x100000",
          "gasPrice": "0x123456789abcde"
        }
      ]
    }' \
    http://localhost:8545 \
    > /dev/null &
done

wait
echo "Sent 1000 transactions"

Observe the eth_getTransactionReceipt results to track when each transaction reaches confirmed status. A missing blockHash or confirmations field in the receipt indicates a node that is not syncing or is slow to finalise.

Diagnosing Node Performance

A blockchain node’s ability to process and serve data is central to overall performance. Use systemctl to monitor service health and journalctl to inspect logs.

systemctl status geth
journalctl -u geth --since "1 hour ago" -f

Look for recurring Error: failed to execute transaction or Failed to write block messages. Use ps aux to check CPU and memory usage:

ps aux | grep geth | awk '{print $2, $3, $4, $11}'

High CPU usage without corresponding block production suggests inefficient transaction processing. High memory usage with growing RSS indicates memory leaks, possibly in the state trie or transaction pool.

Use pg_stat_statements in PostgreSQL to profile database performance, especially when the node uses a database backend.

-- Enable query statistics
CREATE EXTENSION pg_stat_statements;

-- Query average execution time of block insertion
SELECT
  query,
  calls,
  total_time / 1000 AS total_ms,
  mean_time / 1000 AS mean_ms,
  (total_time / calls) / 1000 AS avg_per_call_ms
FROM pg_stat_statements
WHERE query LIKE '%INSERT INTO blocks%'
ORDER BY total_time DESC
LIMIT 10;

Slow INSERT INTO blocks queries indicate database contention. Check pg_locks and pg_stat_activity for blocking queries during block finalization.

Optimising Transaction Processing

To reduce transaction latency, tune the transaction pool (txpool) and adjust gas pricing. Use curl to inspect the txpool state.

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"txpool_status","params":[]}' \
  http://localhost:8545 \
  | jq '.result'

The response includes pending, queued, and current transaction counts. High pending count with low queued suggests the node is processing transactions faster than they arrive. A growing queued count indicates backpressure.

Adjust txpool configuration by editing the node’s configuration file, using standard JSON keys:

{
  "txpool": {
    "journal": "/var/lib/geth/journal",
    "cache": 2048,
    "lifetime": 14400,
    "local": 1024,
    "global": 4096,
    "price": 1000000000,
    "gasprice": 2000000000,
    "minprice": 500000000
  }
}

cache sets the number of transactions stored in memory; lifetime defines how long a transaction stays in the pool before being evicted. price is the base gas price for new transactions, and gasprice and minprice control dynamic pricing.

When transactions are delayed or dropped, check txpool_inspect:

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"txpool_inspect","params":[]}' \
  http://localhost:8545 \
  | jq '.result'

The result shows a list of transactions with hash, sender, value, gasPrice, priority, and queuedSince. Transactions with high priority and queuedSince but low gasPrice are likely being evicted too early.

Monitoring Finality and Consensus Latency

Finality is critical for application performance. Use curl to query eth_getBlockByNumber with full receipts and track confirmation depth.

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_getBlockByNumber","params":["0x100", true]}' \
  http://localhost:8545 \
  | jq '.result.transactions[].receipt.status'

A status of 0x0 indicates a failed transaction; 0x1 indicates success. Use eth_getTransactionReceipt to track when a transaction reaches confirmed status.

For finality, monitor the time between block creation and finality. Use eth_getBlockByNumber to retrieve the timestamp of the latest block, and eth_getBlockByNumber again for the block at number - 1.

# Get latest block
curl -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_getBlockByNumber","params":["latest", false]}' \
  http://localhost:8545 \
  | jq '.result.timestamp'

The difference between the timestamp of consecutive blocks gives block time. Use eth_getBlockByNumber on number - 10 to assess how long it takes for a block to become final.

When finality is delayed, check eth_getSyncing:

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_getSyncing","params":[]}' \
  http://localhost:8545 \
  | jq '.result'

The response includes startingBlock, currentBlock, and highestBlock. A growing currentBlock with startingBlock lagging indicates syncing. A currentBlock that is significantly behind highestBlock suggests the node is catching up.

Tuning for High-Throughput Applications

For applications under heavy load, such as a decentralized exchange or a gaming dApp, tune the node for high throughput. Use systemctl to adjust process limits and ulimit to increase file descriptors.

# In /etc/systemd/system/geth.service
[Service]
ExecStart=/usr/local/bin/geth --datadir /var/lib/geth --rpc --txpool.globalsize 8192 --txpool.cache 4096
LimitNOFILE=65536

Use ulimit -n 65536 to set the number of open file descriptors. Monitor file descriptor usage with lsof:

lsof -p $(pgrep geth) | wc -l

High file descriptor counts indicate that the node is handling many transactions, peers, or database connections.

Use docker stats to monitor containerised nodes:

docker stats --no-stream --format "table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.NetIO}}"

A node with high MemUsage and increasing NetIO is likely under heavy load from peer connections or data transfer.

Handling Common Failure Modes

Silent failures are common in blockchain performance. A transaction is sent, but the receipt is missing blockHash. This indicates a node that is not finalising blocks.

Check eth_getTransactionReceipt:

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_getTransactionReceipt","params":["0xabc123def456"]}' \
  http://localhost:8545 \
  | jq '.result.blockHash'

If blockHash is null, the transaction has not been mined. Use eth_getBlockByHash to confirm the block exists:

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_getBlockByHash","params":["0xabc123def456", true]}' \
  http://localhost:8545 \
  | jq '.result'

If the block does not exist, the node is not syncing or has lost the block data.

Another common issue is transaction batching delays. A dApp sends 10 transactions per second, but finality occurs every 30 seconds. This suggests that the node is not finalising blocks efficiently.

Check eth_getBlockByNumber for the block at number - 10:

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_getBlockByNumber","params":["0x1000", true]}' \
  http://localhost:8545 \
  | jq '.result.timestamp'

A large gap between the timestamp of consecutive blocks indicates slow block production. Check eth_getBlockByNumber on number - 1 and number - 2 to verify the block time.

Finally, a transaction that is confirmed but not finalized suggests that consensus is delayed. Use eth_getBlockByNumber on number - 1 and number - 2 to confirm that the block has been confirmed by a sufficient number of validators.

Summary of Key Commands and Configuration

Configuration keys are standard across implementations: txpool.cache, txpool.globalsize, txpool.lifetime, txpool.price, txpool.gasprice, txpool.minprice. Use json for configuration files, systemd for process management, postgresql for state storage.

Performance is not a property of the blockchain—it is a result of careful measurement, tuning, and monitoring. When a transaction takes 30 seconds to finalise, and a user sees a “Transaction submitted” message but no update for 10 minutes, the engineering team must use these tools to uncover the root cause.

This page was rewritten on 18 October 2026. It replaced a templated version that was not specific to its own title. How these pages are written and checked. If anything here is wrong, tell us at [email protected] and we will correct it.