Difference between revisions of "Performance testing tools"

From Ever changing code
Jump to navigation Jump to search
(Created page with "= Repositories = * [https://devops.com/infrastructure-validation-with-inspec/ inspect infrastructure] tool")
 
Line 1: Line 1:
= [https://github.com/tsenart/vegeta Vegeta] =
Docker images
* https://github.com/peter-evans/vegeta-docker
* https://hub.docker.com/r/peterevans/vegeta
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
<source lang=bash>
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
k cp vegeta/vegeta-5847d879d8-p9kqw:plot.html ./plot.html -c vegeta
</source>
= Repositories =
= Repositories =
* [https://devops.com/infrastructure-validation-with-inspec/ inspect infrastructure] tool
* [https://devops.com/infrastructure-validation-with-inspec/ inspect infrastructure] tool

Revision as of 14:55, 24 June 2021

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
k cp vegeta/vegeta-5847d879d8-p9kqw:plot.html ./plot.html -c vegeta

Repositories