Solana getBlock Performance FAQ

Last updated: May 6, 2025

Common Issues

Why is my getBlock request taking so long to respond?

Several factors can contribute to slow getBlock response times:

  • High Concurrency: Running too many concurrent request.

  • Request Configuration: Inefficient encoding or parsing options

  • Large Response Size: Block data, especially with jsonParsed, can be up to ~5MB per block

  • Network Limitations: Client-side bandwidth or latency issues

  • RPC Node Load: Server-side congestion during peak usage

I'm experiencing timeouts or degraded performance when running multiple requests. Why?

There is a known performance when querying blocks concurrently with the jsonParsed parameter. The RPC nodes may struggle to handle numerous simultaneous requests that require JSON parsing of transaction data.

Optimization Recommendations

How can I improve getBlock response time?

  • Limit Concurrency

    • Reduce concurrent requests to a lower level of RPS (requests per second)

    • Implement proper request queuing in your client application

    • Consider batching non-time-sensitive requests

  • Optimize Request Header

    • Always use compression by adding the header: --header 'Accept-Encoding: gzip'. This significantly reduces data transfer size and improves response time. You can also use --header 'Accept-Encoding: zstd' which is much faster than standard gzip encoding.

  • Use Alternative Parsing Options

    • Consider using base64 encoding instead of jsonParsed when possible.

    • Parse the base64 data client-side for better overall throughput

  • Implement Client-Side Caching

    • Cache frequently accessed blocks to avoid redundant requests

    • Implement proper cache invalidation strategies

  • Consider Network Capacity

    • Each block with jsonParsed can be approximately 5MB in size

    • When running concurrent jobs, total bandwidth requirements stack up quickly

    • Ensure your client has sufficient network capacity to handle the expected throughput

Should I still use jsonParsed at all?

jsonParsed is convenient but comes with performance costs. Consider:

  • Using it for low-volume, exploratory work

  • Switching to base64 for high-volume production systems

  • Implementing client-side parsing for better scalability

Advanced Considerations

I need high throughput. What architecture should I use?

For production systems requiring high throughput:

  • Build a Block Ingestion Service

    • Create a dedicated service that pulls blocks systematically

    • Store parsed data in a database optimized for your query patterns

    • Serve requests from your database instead of making RPC calls for each client request

  • Implement Smart Retries

    • Use exponential backoff for failed requests

    • Diversify RPC endpoints when possible

    • Monitor for rate limiting and adjust accordingly

  • Upgrade to Dedicated Clusters

    • Consider upgrading to a dedicated Solana RPC cluster instead of using shared infrastructure

    • Dedicated clusters eliminate resource competition from other users

    • This provides more consistent performance, especially during high traffic periods

    • While more expensive, dedicated clusters offer predictable performance for production applications

We're committed to helping you achieve optimal performance with the Solana blockchain.