测试 请问有哪些办法可以做性能测试?

darkbaby123 · 2013年03月12日 · 最后由 holin 回复于 2013年05月09日 · 3013 次阅读

我不知道这应该归类于性能测试还是压力测试,但需求大概是这样:

  1. 网站需要登录才能进去操作。
  2. 我想模拟多个用户同时登录网站进行操作,操作本身可以简单看成不停的发起指定的请求(不止一个)。
  3. 能写脚本来自定义行为就更好了,比如判断访问某 url 是否跳转了,等等。

原来是用 jmeter 来做这件事,但我觉得还是不大好用,配置挺麻烦,而且不够智能。请教下各位有没有什么先进点的办法?

ab 可以吧。不知道是否支持登陆。

@chenge ab 当时没研究出来怎么登录,因为一些操作是跟 session 相关的,有一定连续性,比如登录然后跳转到主页然后订阅。看中 jmeter 就是因为可以通过事先设置 cookie 的方式让用户登录,但配置也很麻烦……

@bjyuxiao 这个是收费的吧……而且感觉太专业向了,程序员搞不起。

ab 也可以带 cookie 吧。

$ ab -h
Usage: ab [options] [http[s]://]hostname[:port]/path Options are: -n requests Number of requests to perform -c concurrency Number of multiple requests to make at a time -t timelimit Seconds to max. to spend on benchmarking This implies -n 50000 -s timeout Seconds to max. wait for each response Default is 30 seconds -b windowsize Size of TCP send/receive buffer, in bytes -B address Address to bind to when making outgoing connections -p postfile File containing data to POST. Remember also to set -T -u putfile File containing data to PUT. Remember also to set -T -T content-type Content-type header to use for POST/PUT data, eg. 'application/x-www-form-urlencoded' Default is 'text/plain' -v verbosity How much troubleshooting info to print -w Print out results in HTML tables -i Use HEAD instead of GET -x attributes String to insert as table attributes -y attributes String to insert as tr attributes -z attributes String to insert as td or th attributes -C attribute Add cookie, eg. 'Apache=1234'. (repeatable) -H attribute Add Arbitrary header line, eg. 'Accept-Encoding: gzip'

需要 登录 后方可回复, 如果你还没有账号请 注册新账号