api压力测试工具简介 这里介绍两个我常用的测试工具:vegeta 和 wrk,现在我一般都用前者 Vegeta( 贝吉塔 ) 这是一个开源软件,类似 wrk ,但是是用 go 写的,功能更为强大,也更易用一些。 Github 地址 下面是命令列表: Usage: vegeta [global flags] <command> [command flags] global flags: -cpus int Number of CPUs to use (defaults to the number of CPUs you have) -profile string Enable profiling of [cpu, heap] -version Print version and exit attack command: -body string Requests body file -cert string TLS client PEM encoded certificate file -chunked Send body with chunked transfer encoding -connections int Max open idle connections per target host (default 10000) -duration duration Duration of the test [0 = forever] -format string Targets format [http, json] (default "http") -h2c Send HTTP/2 requests without TLS encryption -header value Request header -http2 Send HTTP/2 requests when supported by the server (default true) -insecure Ignore invalid server TLS certificates -keepalive Use persistent connections (default true) -key string TLS client PEM encoded private key file -laddr value Local IP address (default 0.