Performance testing tools

From Ever changing code
Jump to navigation Jump to search

Vegeta

Docker images


Kubernetes deployment <syntaxhighlightjs lang="yaml"> kubectl apply -f <(cat <<EOF apiVersion: apps/v1 kind: Deployment metadata:

 name: vegeta
 labels:
   app: vegeta

spec:

 replicas: 1
 selector:
   matchLabels:
     app: vegeta
 template:
   metadata:
     labels:
       app: vegeta
   spec:
     containers:
     - name: vegeta
       image: peterevans/vegeta:6.9.1-vegeta12.8.4
       args:
       - sh
       - -c
       - sleep 36000 # 3600
       ports:
       - containerPort: 80
       resources:
         limits:
           cpu: 4000m # '1'
           memory: 1Gi
         requests:
           cpu: 2000m # '1'
           memory: 1Gi
     nodeSelector:
      node.kubernetes.io/lifecycle: spot

EOF ) --dry-run=server </syntaxhighlightjs>


Operations

URL=http://example.com/healthcheck
kubectl -n vegeta run vegeta --rm --attach --restart=Never --image="peterevans/vegeta" -- sh -c "echo 'GET $URL' | vegeta attack -rate=10 -duration=30s | tee results.bin | vegeta report"

# On the pod/localsystem

echo 'GET $URL' | vegeta attack -rate=10 -duration=30s | tee results.bin | vegeta report
cat results.bin | vegeta plot > plot.html

# On a laptop
kubectl cp vegeta/vegeta-5847d879d8-p9kqw:plot.html ./plot.html -c vegeta

Repositories