indexer-performance

star 527

Use when optimizing indexer speed or tuning sync performance. HyperSync vs RPC, batch size, RPC tuning parameters, WebSocket config, and preload optimization.

enviodev By enviodev schedule Updated 5/25/2026

name: indexer-performance description: >- Use when optimizing indexer speed or tuning sync performance. HyperSync vs RPC, batch size, RPC tuning parameters, WebSocket config, and preload optimization. metadata: managed-by: envio

Performance Tuning

HyperSync (Default — Fastest)

HyperSync is the default data source for supported chains. Up to 1000x faster than RPC. No configuration needed — automatic for supported networks.

Batch Size

full_batch_size: 5000  # Target events per batch (default: 5000)

Reduce if handlers make many slow Effect API calls that can't be batched.

RPC Tuning

When using RPC as a data source, tune these parameters per chain:

chains:
  - id: 1
    rpc:
      - url: ${ENVIO_RPC_URL}
        for: sync                    # sync | realtime | fallback
        ws: ${ENVIO_WS_URL}               # WebSocket for lower-latency realtime block detection
        initial_block_interval: 5000 # Starting blocks per query
        backoff_multiplicative: 0.8  # Scale factor after RPC error (0.5-0.9)
        acceleration_additive: 1000  # Blocks added per successful query
        interval_ceiling: 10000      # Max blocks per query
        backoff_millis: 5000         # Wait after error before retry (ms)
        query_timeout_millis: 20000  # Cancel RPC request after this (ms)
        fallback_stall_timeout: 5000 # Switch to next RPC after stall (ms)
        polling_interval: 1000       # Check for new blocks every N ms (default: 1000)

RPC for Options

Value Description
sync RPC as main data source for both historical and realtime
realtime HyperSync for historical, switch to RPC for realtime (lower latency)
fallback Backup when primary stalls (default when HyperSync available)

WebSocket for Realtime Indexing

Add ws: for lower-latency new block detection via eth_subscribe("newHeads"):

rpc:
  - url: ${ENVIO_RPC_ENDPOINT}
    ws: ${ENVIO_WS_ENDPOINT}
    for: realtime

Database Indexes

Add @index to schema fields for faster queries — see indexer-schema for full syntax (single-field, composite, DESC direction).

If something is unclear, use the envio-docs skill to search and read the latest documentation.

Install via CLI
npx skills add https://github.com/enviodev/hyperindex --skill indexer-performance
Repository Details
star Stars 527
call_split Forks 50
navigation Branch main
article Path SKILL.md
More from Creator