Skip to content

Commit

Permalink
make txBacklogSize responsive to block size (#4377)
Browse files Browse the repository at this point in the history
  • Loading branch information
brianolson authored Aug 9, 2022
1 parent a83eac7 commit 2d51070
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion data/txHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"io"
"sync"

"github.com/algorand/go-algorand/config"
"github.com/algorand/go-algorand/crypto"
"github.com/algorand/go-algorand/data/bookkeeping"
"github.com/algorand/go-algorand/data/pools"
Expand All @@ -38,7 +39,8 @@ import (
// The size txBacklogSize used to determine the size of the backlog that is used to store incoming transaction messages before starting dropping them.
// It should be configured to be higher then the number of CPU cores, so that the execution pool get saturated, but not too high to avoid lockout of the
// execution pool for a long duration of time.
const txBacklogSize = 1000
// Set backlog at 'approximately one block' by dividing block size by a typical transaction size.
var txBacklogSize = config.Consensus[protocol.ConsensusCurrentVersion].MaxTxnBytesPerBlock / 200

var transactionMessagesHandled = metrics.MakeCounter(metrics.TransactionMessagesHandled)
var transactionMessagesDroppedFromBacklog = metrics.MakeCounter(metrics.TransactionMessagesDroppedFromBacklog)
Expand Down

0 comments on commit 2d51070

Please sign in to comment.