AB post test HTTP and WebService interface method and use case


AB (APACHE bench) is a hypertext transfer protocol (HTTP) performance testing tool that comes with Apache. Its design intention is to describe the execution performance of the currently installed Apache, mainly to show how many requests Apache can process per second.

useab -helpView help interface

  1. AB testing simple HTTP requests

    ab -n30000 -c1000 ""
  2. AB test HTTP interface (post)

    ab -n400 -c20  -p "img.json" -T "application/x-www-form-urlencoded" "" 

    img.json Is a string that conforms to the interface format

    MIME types application / x-www-form-urlencoded and multipart / form data and text / plain references

    Similar to curl, curl specifies post, please @ specify file

    curl "" -d  @/root/img.json
  3. AB test WebService interface

    ab -k -T "Content-Type:text/xml;charset=UTF-8" -p data.xml -n 1000 -c 32 

    be careful: data.xml Must conform to the WSDL specification and can be generated using soapUI

    If an error is reported:no soapaction header

    ab -k -T "Content-Type:text/xml;charset=UTF-8;soapaction=''" -p data.xml -n 1000 -c 32

Other references: detailed explanation of pressure test with ab