-
Notifications
You must be signed in to change notification settings - Fork 158
Open
Labels
proposalEnhancement idea or proposalEnhancement idea or proposal
Description
Proposed change
We publish zeroes here:
Line 1757 in f479ef0
| buffer := make([]byte, msgSize) |
This may skew the results because of compression usage, etc.
Should probably use https://pkg.go.dev/crypto/rand#Read
Also related, when --payload is used:
Lines 1749 to 1752 in f479ef0
| buffer, err := os.ReadFile(c.payloadFilename) | |
| if err != nil { | |
| return nil, fmt.Errorf("reading the payload file: %w", err) | |
| } |
It problably makes sense to read the file only once, not once per client, to make this work:
nats bench pub hello --clients=30 --msgs=30 --payload <(head --bytes=1M /dev/urandom)
Otherwise, the named pipe that bash creates is "split" across N goroutines reading it concurrently. So total published size will be 1M, not 30M in this case.
Use case
Benchmarks that are closer resemble real workloads.
Contribution
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
proposalEnhancement idea or proposalEnhancement idea or proposal