FuelLabs / fuel-indexer

🗃 The Fuel indexer is a standalone service that can be used to index various components of the Fuel blockchain.
https://docs.fuel.network/docs/indexer/
140 stars 66 forks source link

bugfix: set max_connections sqlx parameter #1508

Closed lostman closed 10 months ago

lostman commented 10 months ago

Description

Fixes #1507.

The default value for max_connections in sqlx is 10. From some testing, our number of DB connections per indexer can go up to ~6 and so, running fuel-indexer with more than one indexer could lead to failures.

This PR sets the default to 100 and adds a CLI flag to modify it.

Also, a warning will be issued if the set config value exceeds what is set in the backend.

Testing steps

cargo run -p fuel-indexer-benchmarks --bin qa -- --network beta-4.fuel.network --blocks 500 --runs 4 --num-additional-indexers 10

Should succeed.

Example: with --num-additional-indexers 10we get up to43` connections

run: 1
    runtime:        0.3 minutes
    start block:    0
    end block:      500
    avg memory:     241.3kB
    stdv memory:    0.0kB
    avg cpu:        1.5%
    stdv cpu:       0.0%
    db connections: 43/100
    missing blocks: 0
    blocks/sec:     26.3
    index size:     8.089kB per block

Changelog