Browse Source

e2e: load should be proportional to network (#6983)

pull/6988/head
Sam Kleinman 3 years ago
committed by GitHub
parent
commit
5ccd668c78
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 8 deletions
  1. +12
    -8
      test/e2e/runner/load.go

+ 12
- 8
test/e2e/runner/load.go View File

@ -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. // CPU. This gives high-throughput small networks and low-throughput large ones.
// This also limits the number of TCP connections, since each worker has // This also limits the number of TCP connections, since each worker has
// a connection to all nodes. // 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) chTx := make(chan types.Tx)
@ -32,7 +32,11 @@ func Load(ctx context.Context, testnet *e2e.Testnet) error {
defer cancel() defer cancel()
// Spawn job generator and processors. // 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() started := time.Now()
go loadGenerate(ctx, chTx, testnet.TxSize) go loadGenerate(ctx, chTx, testnet.TxSize)
@ -78,8 +82,8 @@ func Load(ctx context.Context, testnet *e2e.Testnet) error {
logger.Info("ending transaction load", logger.Info("ending transaction load",
"dur_secs", time.Since(started).Seconds(), "dur_secs", time.Since(started).Seconds(),
"txns", success, "txns", success,
"rate", rate,
"slow", rate < 1)
"workers", concurrency,
"rate", rate)
return nil return nil
} }
@ -129,8 +133,8 @@ func loadGenerate(ctx context.Context, chTx chan<- types.Tx, size int64) {
func loadGenerateWaitTime(size int64) time.Duration { func loadGenerateWaitTime(size int64) time.Duration {
const ( const (
min = int64(100 * time.Millisecond)
max = int64(time.Second)
min = int64(10 * time.Millisecond)
max = int64(100 * time.Millisecond)
) )
var ( var (


Loading…
Cancel
Save