Kubernetes: ab based stress testing

Time:2020-11-21

Pressure test based on ab

# cat apache-test.yaml 
##########################################################################
#Author:                     zisefeizhu
#QQ:                         2********0
#Date:                       2020-08-03
#FileName:                   apache-test.yaml
#URL:                        https://www.cnblogs.com/zisefeizhu/
#Description:                The test script
#Copyright (C):              2020 All rights reserved
###########################################################################
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
  name: apache
  namespace: default
  labels:
    name: apache

spec:
  #Replicas: the number of pods from 3    
  selector:
    matchLabels:
      name: apache
  template:
    metadata:
      labels:
        name: apache
    spec:
      containers:
      - name: apache
        Image: httpd ා use image
        Command: ["ab", "- C 30", "- N 100000"] # execute the command
        args: [" https://xxx.xxxxx.com/ "], pressure test domain name
        ports:
        - name: http
          containerPort: 80

The main reason for writing this is that spec.template.containers The use of the command and args fields under

Recommended Today

PHP 12th week function learning record

sha1() effect sha1()Function to evaluate the value of a stringSHA-1Hash. usage sha1(string,raw) case <?php $str = “Hello”; echo sha1($str); ?> result f7ff9e8b7bb2e09b70935a5d785e0cc5d9d0abf0 sha1_file() effect sha1_file()Function calculation fileSHA-1Hash. usage sha1_file(file,raw) case <?php $filename = “test.txt”; $sha1file = sha1_file($filename); echo $sha1file; ?> result aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d similar_text() effect similar_text()Function to calculate the similarity between two strings. usage similar_text(string1,string2,percent) case […]