测试cookie
带个cookie就能模拟已登录用户进行操作了
---------------------
测试post请求
post file
------------------
ab命令存在的问题
ab中出错的信息不准,它将ContentLength不同都算出错,这个对于动态页面来说会有为问题。 另外如果服务器返回500, 它反而不会认为这个是错误。 apache2.4的ab也是有这个问题。 可以看 Non-2xx responses 的参数
apache2.4安装相当麻烦(windows/linux 都是),需要安装好几个第三方包 apr等,多出一个abs命令,用来专门测试https的。
ab命名的响应时间不包括资源文件下载的时间
-------------------
ab命令
ab -n 100 -c 10
ab -n 100 -c 10 http://localhost:8081/jpetstore2/shop/viewItem.shtml?itemId=EST-6
ab -n 100 -c 10 http://localhost:8081/jpetstore6/actions/Catalog.action?viewItem=&itemId=EST-7
用JPetStore来测试
发现struts1 中的单例是对同一个session而言的 (如果action配的是scope="session"), 对于不同session是不同的实例。 基本上不存在synchronized的问题。
如果scope="request" 则每次请求都会生成一个实例
增加action的响应时间 用visualVM 来监控 heap大小
虽然其方法没有加synchronized,但是感觉系统自己加了?
需要看struts1的源代码
另外service类是每次new出来的, 所以如果在其成员变量中给个
private byte[] b =new byte[5*1024*1024];
一会就会出现OOM的异常
带个cookie就能模拟已登录用户进行操作了
ab -n 5 -C JSESSIONID=C7801B902756E05542EB45DDCBE45AD1 http://localhost:8085/log-view-app/HomeServlet
---------------------
测试post请求
ab -n 100 -c 10 -p p1.txt -T application/x-www-form-urlencoded http://localhost:8085/tristanSpringMVC03/user/update
post file
id=0&userName=99&age=99&gender=99&height=99&weight=99&city=99&speciality=99&interest=99
------------------
ab命令存在的问题
ab中出错的信息不准,它将ContentLength不同都算出错,这个对于动态页面来说会有为问题。 另外如果服务器返回500, 它反而不会认为这个是错误。 apache2.4的ab也是有这个问题。 可以看 Non-2xx responses 的参数
apache2.4安装相当麻烦(windows/linux 都是),需要安装好几个第三方包 apr等,多出一个abs命令,用来专门测试https的。
ab命名的响应时间不包括资源文件下载的时间
-------------------
ab命令
ab -n 100 -c 10
ab -n 100 -c 10 http://localhost:8081/jpetstore2/shop/viewItem.shtml?itemId=EST-6
ab -n 100 -c 10 http://localhost:8081/jpetstore6/actions/Catalog.action?viewItem=&itemId=EST-7
用JPetStore来测试
发现struts1 中的单例是对同一个session而言的 (如果action配的是scope="session"), 对于不同session是不同的实例。 基本上不存在synchronized的问题。
如果scope="request" 则每次请求都会生成一个实例
增加action的响应时间 用visualVM 来监控 heap大小
虽然其方法没有加synchronized,但是感觉系统自己加了?
需要看struts1的源代码
另外service类是每次new出来的, 所以如果在其成员变量中给个
private byte[] b =new byte[5*1024*1024];
一会就会出现OOM的异常