From ff4a3f87691ca85019bf950cd4c5c5ac673ab9dc Mon Sep 17 00:00:00 2001 From: Raul Sevilla Date: Mon, 2 Oct 2023 14:14:40 +0200 Subject: [PATCH] Not write results in disk, use max-body=0 Signed-off-by: Raul Sevilla --- config/vegeta.yml | 75 ++++++++++++++++++++++++++++++++------ pkg/runner/tools/vegeta.go | 11 ++++-- 2 files changed, 71 insertions(+), 15 deletions(-) diff --git a/config/vegeta.yml b/config/vegeta.yml index 03caae4..50aed8e 100644 --- a/config/vegeta.yml +++ b/config/vegeta.yml @@ -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 diff --git a/pkg/runner/tools/vegeta.go b/pkg/runner/tools/vegeta.go index 6570a2d..0b20952 100644 --- a/pkg/runner/tools/vegeta.go +++ b/pkg/runner/tools/vegeta.go @@ -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