tsenart/vegeta · error
-max-body= overflows int64
Error message
-max-body=%d overflows int64
What it means
The -max-body flag parses its value with a datasize.ByteSize (text form like 10MB). If the parsed size exceeds math.MaxInt64, it cannot be stored in the flag's int64 target, so Set returns this overflow error before assigning.
Solutions
- Lower the -max-body value so it fits in int64 (< 9223372036854775807 bytes, i.e. < 8EB).
- Use a sane size like -max-body=10MB.
- Validate the configured size before passing it to vegeta.
- Check for duplicated or concatenated suffixes (e.g. 10MBMB) that inflate the parsed value.
Example fix
// before vegeta attack -max-body=9223372036854775808B ... // after vegeta attack -max-body=10MB ...
Defensive patterns
Strategy: validation
Validate before calling
const maxInt64 uint64 = math.MaxInt64
func fitsInt64(s string) bool {
var ds datasize.ByteSize
if err := ds.UnmarshalText([]byte(s)); err != nil {
return false
}
return uint64(ds) <= maxInt64
} Prevention
- Keep -max-body within realistic sizes (KB/MB/GB).
- Check for typo'd or duplicated size suffixes.
- Remember the limit is math.MaxInt64 bytes (< 8EB).
- Validate size strings in config before passing to vegeta.
When it happens
Trigger: Calling MaxBody.Set (or -max-body) with a datasize whose byte value exceeds math.MaxInt64, e.g. 9223372036854775808B or exabyte-range values.
Common situations: Typo in the size suffix or unit causing an enormous multiplier (e.g. 10EB); generated configs with unsanitized sizes; misunderstanding that the value is bytes capped at int64.
Related errors
- bad buckets
- invalid -connect-to , expected format
- -rate format doesn't match the "freq/duration" format (i.e…
- encode: can't detect encoding of
- encode: unknown encoding
AI-assisted analysis of tsenart/vegeta@cf58112690 (2026-08-31).
Data as JSON: /api/errors/7e3a727e301b0107.
Report an issue: GitHub.
Appendix: source
Thrown at flags.go:121
}
return fmt.Sprintf("%d/%s", f.Freq, f.Per)
}
type maxBodyFlag struct{ n *int64 }
func (f *maxBodyFlag) Set(v string) (err error) {
if v == "-1" {
*(f.n) = -1
return nil
}
var ds datasize.ByteSize
if err = ds.UnmarshalText([]byte(v)); err != nil {
return err
}
if ds > math.MaxInt64 {
return fmt.Errorf("-max-body=%d overflows int64", ds)
}
*(f.n) = int64(ds)
return nil
}
func (f *maxBodyFlag) String() string {
if f.n == nil {
return ""
} else if *(f.n) == -1 {
return "-1"
}
return datasize.ByteSize(*(f.n)).String()
}
type dnsTTLFlag struct{ ttl *time.Duration }
func (f *dnsTTLFlag) Set(v string) (err error) {View on GitHub (pinned to cf58112690)