integration: warmup (#6386)

This commit is contained in:
Alex Sharov 2022-12-20 21:56:32 +07:00 committed by GitHub
parent 1fdc7fadfb
commit 999e651a88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -150,7 +150,8 @@ func init() {
}
func doWarmup(ctx context.Context, chaindata string, bucket string) error {
db := mdbx2.NewMDBX(log.New()).Path(chaindata).RoTxsLimiter(semaphore.NewWeighted(100_000)).Readonly().MustOpen()
const ThreadsLimit = 5_000
db := mdbx2.NewMDBX(log.New()).Path(chaindata).RoTxsLimiter(semaphore.NewWeighted(ThreadsLimit)).Readonly().MustOpen()
defer db.Close()
var total uint64
@ -165,6 +166,7 @@ func doWarmup(ctx context.Context, chaindata string, bucket string) error {
defer logEvery.Stop()
g, ctx := errgroup.WithContext(ctx)
g.SetLimit(ThreadsLimit)
for i := 0; i < 256; i++ {
for j := 0; j < 256; j++ {
i := i