mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-08 06:15:33 +00:00
e2e: load should be proportional to network (#6983)
This commit is contained in:
@@ -21,9 +21,9 @@ func Load(ctx context.Context, testnet *e2e.Testnet) error {
|
||||
// CPU. This gives high-throughput small networks and low-throughput large ones.
|
||||
// This also limits the number of TCP connections, since each worker has
|
||||
// a connection to all nodes.
|
||||
concurrency := 64 / len(testnet.Nodes)
|
||||
if concurrency == 0 {
|
||||
concurrency = 1
|
||||
concurrency := len(testnet.Nodes) * 8
|
||||
if concurrency > 64 {
|
||||
concurrency = 64
|
||||
}
|
||||
|
||||
chTx := make(chan types.Tx)
|
||||
@@ -32,7 +32,11 @@ func Load(ctx context.Context, testnet *e2e.Testnet) error {
|
||||
defer cancel()
|
||||
|
||||
// Spawn job generator and processors.
|
||||
logger.Info(fmt.Sprintf("Starting transaction load (%v workers)...", concurrency))
|
||||
logger.Info("starting transaction load",
|
||||
"workers", concurrency,
|
||||
"nodes", len(testnet.Nodes),
|
||||
"tx", testnet.TxSize)
|
||||
|
||||
started := time.Now()
|
||||
|
||||
go loadGenerate(ctx, chTx, testnet.TxSize)
|
||||
@@ -78,8 +82,8 @@ func Load(ctx context.Context, testnet *e2e.Testnet) error {
|
||||
logger.Info("ending transaction load",
|
||||
"dur_secs", time.Since(started).Seconds(),
|
||||
"txns", success,
|
||||
"rate", rate,
|
||||
"slow", rate < 1)
|
||||
"workers", concurrency,
|
||||
"rate", rate)
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -129,8 +133,8 @@ func loadGenerate(ctx context.Context, chTx chan<- types.Tx, size int64) {
|
||||
|
||||
func loadGenerateWaitTime(size int64) time.Duration {
|
||||
const (
|
||||
min = int64(100 * time.Millisecond)
|
||||
max = int64(time.Second)
|
||||
min = int64(10 * time.Millisecond)
|
||||
max = int64(100 * time.Millisecond)
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
Reference in New Issue
Block a user