Skip to content

Commit

Permalink
Not write results in disk, use max-body=0
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Sevilla <rsevilla@redhat.com>
  • Loading branch information
rsevilla87 committed Oct 3, 2023
1 parent cd9c405 commit ff4a3f8
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 15 deletions.
75 changes: 63 additions & 12 deletions config/vegeta.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,65 @@
# vim: expandtab shiftwidth=2 softtabstop=2
# vi: expandtab shiftwidth=2 softtabstop=2

# First scenario is configured as warmup and it will also tune the default ingress-controller to assign the router pods to the infra nodes
- termination: http
connections: 200
samples: 1
duration: 30s
path: /128.html
concurrency: 2
tool: vegeta
serverReplicas: 9
requestTimeout: 2s
warmup: false
keepalive: false
threads: 50
connections: 400
samples: 5
duration: 2m
path: /256.html
concurrency: 9
tool: vegeta
serverReplicas: 45
tuningPatch: '{"spec":{"nodePlacement": {"nodeSelector": {"matchLabels": {"node-role.kubernetes.io/infra": ""}}}, "replicas": 2}}'
delay: 10s
threads: 400
requestTimeout: 10s
warmup: true

- termination: reencrypt
connections: 400
samples: 2
duration: 2m
path: /256.html
concurrency: 9
tool: vegeta
serverReplicas: 45
threads: 400
requestTimeout: 10s
delay: 10s

- termination: http
connections: 400
samples: 2
duration: 2m
path: /256.html
concurrency: 9
tool: vegeta
serverReplicas: 45
threads: 400
requestTimeout: 10s
delay: 10s

- termination: edge
connections: 400
samples: 2
duration: 2m
path: /256.html
concurrency: 9
tool: vegeta
serverReplicas: 45
threads: 400
requestTimeout: 10s
delay: 10s


- termination: passthrough
connections: 400
samples: 2
duration: 2m
path: /256.html
concurrency: 9
tool: vegeta
serverReplicas: 45
threads: 400
requestTimeout: 10s
delay: 10s
11 changes: 8 additions & 3 deletions pkg/runner/tools/vegeta.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,20 @@ func init() {

func Vegeta(cfg config.Config, ep string) Tool {
endpoint := fmt.Sprintf("echo GET %v", ep)
vegetaCmd := fmt.Sprintf("vegeta attack -insecure -max-connections=%d -duration=%v -timeout=%v -keepalive=%v", cfg.Connections, cfg.Duration, cfg.RequestTimeout, cfg.Keepalive)
vegetaCmd := fmt.Sprintf("vegeta attack -insecure -max-connections=%d -duration=%v -timeout=%v -keepalive=%v -max-body=0",
cfg.Connections,
cfg.Duration,
cfg.RequestTimeout,
cfg.Keepalive,
)
if cfg.RequestRate > 0 {
vegetaCmd += fmt.Sprintf(" -rate %d", cfg.RequestRate)
vegetaCmd += fmt.Sprintf(" -rate=%d", cfg.RequestRate)
} else {
vegetaCmd += fmt.Sprintf(" -rate=0 -workers=%d -max-workers=%d", cfg.Threads, cfg.Threads)
}

newWrk := &vegeta{
cmd: []string{"bash", "-c", fmt.Sprintf("%v | %v > /tmp/result; vegeta report -type json /tmp/result", endpoint, vegetaCmd)},
cmd: []string{"bash", "-c", fmt.Sprintf("%v | %v | vegeta report -type json", endpoint, vegetaCmd)},
res: VegetaResult{},
}
return newWrk
Expand Down

0 comments on commit ff4a3f8

Please sign in to comment.