Skip to content

Commit

Permalink
fix: increase provider sample size (#10589)
Browse files Browse the repository at this point in the history
  • Loading branch information
lidel authored Nov 25, 2024
1 parent d506003 commit d1f6541
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/node/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ import (
"go.uber.org/fx"
)

// The size of a batch that will be used for calculating average announcement
// time per CID, inside of boxo/provider.ThroughputReport
// and in 'ipfs stats provide' report.
const sampledBatchSize = 1000

func ProviderSys(reprovideInterval time.Duration, acceleratedDHTClient bool) fx.Option {
const magicThroughputReportCount = 128
return fx.Provide(func(lc fx.Lifecycle, cr irouting.ProvideManyRouter, keyProvider provider.KeyChanFunc, repo repo.Repo, bs blockstore.Blockstore) (provider.System, error) {
opts := []provider.Option{
provider.Online(cr),
Expand Down Expand Up @@ -105,7 +109,7 @@ https://github.com/ipfs/kubo/blob/master/docs/config.md#routingaccelerateddhtcli
keysProvided, avgProvideSpeed, count, avgProvideSpeed*time.Duration(count), reprovideInterval)
}
return false
}, magicThroughputReportCount))
}, sampledBatchSize))
}
sys, err := provider.New(repo.Datastore(), opts...)
if err != nil {
Expand Down

0 comments on commit d1f6541

Please sign in to comment.