我想用我的Rails应用程序中的apache bench来加载测试创建动作,但ab似乎没有发送POST数据 - 尽管它确实提交了POST而不是GET请求。Apache Bench和POST数据
这是我运行命令:
ab -n 1 -p post -v 4 "http://oz01.zappos.net/registrations"
,这是后文件的内容:
authenticity_token=M18KXwSOuIVbDPZOVQy5h8aSGoU159V9S5uV2lpsAI0
轨道日志显示POST请求透进来,但没有表现出任何正在发布的参数:
Started POST "/registrations" for 10.66.210.70 at Thu Sep 09 17:48:06 -0700 2010
Processing by RegistrationsController#create as */*
Rendered registrations/new.html.erb within layouts/application (14.0ms)
Completed 200 OK in 24ms (Views: 14.6ms | ActiveRecord: 0.1ms)
而来自浏览器的POST请求导致此日志条目:
Started POST "/registrations" for 192.168.66.20 at Thu Sep 09 17:49:47 -0700 2010
Processing by RegistrationsController#create as HTML
Parameters: {"submit"=>"true", "authenticity_token"=>"AfNG0UoTbJXnxke2725efhYAoi3ogddMC7Uqu5mAui0=", "utf8"=>"\342\234\223", "registration"=>{"city"=>"", "address"=>"", "name"=>"", "zip"=>"", "optin"=>"0", "state"=>"", "email"=>""}}
Rendered registrations/new.html.erb within layouts/application (13.7ms)
Completed 200 OK in 24ms (Views: 14.3ms | ActiveRecord: 0.1ms)
最后,这是要求什么AB日志:
---
POST /registrations HTTP/1.0
User-Agent: ApacheBench/2.0.40-dev
Host: oz01.zappos.net
Accept: */*
Content-length: 63
Content-type: text/plain
---
为什么不拿起后的数据?
如果“后”文件不存在,然后我得到一个错误消息说,它不能找到该文件,所以我知道它至少是找到文件...
我只不过这次用150K的文件,AB只出现在我的脚本吐出它的80K几乎一样的问题,这由于内容长度的原因阻塞等待更多IO。你身边有幸运吗? – Xailor 2012-02-25 05:11:27