服务器性能优化测试(一)
http://[2001:0:9d38:953c:3d:1e49:3f57:fe97]:6001/OrderService/ OrderServiceService?WSDL
确定后进入下一步,生成 MockService
Path 是生成的本地服务路径,Port 是端口。 Starts the MockService immediately 选项可选可不选。 完成之后会在左边的树形结构中生成 3 部分:
服务器性能优化测试(一)
任务要求 本任务要完成 64bit JDK 环境下 WebLogic 服务器运行性能。并
进行服务器优化。 任务计划
1. 将运行环境设置为 64bit JDK 环境,在 console 测试服务器 运行情况(是否出现 out of memory 等异常);
2. 根据异常情况调整服务器环境的设置; 3. 用 Jmeter 测试服务器运行性能; 4. 根据异常情况进行服务器优化。 测试服务器
选择你的 MilkRunShowTest User element。右击选择添加 Config Element 中的 WebService(SOAP) Request。然后选择这个新的元素查 看他的控制面板。
添加 addNewPurchaseOrder 测试 WebService(SOAP) Request
Creates a TestSuite for the imported WSDL or WADL:为 WSDL 或 WADL 创建一个测试包
Create a Web Service Simulation of the imported WSDL:为 WSDL 创建一个模拟的服务端
Initial WSDL/WADL:指定一个 WSDL/WADL 的路径,可 以是本地或网络 URL。这里我们填写:
每个 JMeter 测试计划的第一步都是要添加一个 Thread Group element。Thread Group 告诉 JMeter 你要设置的用户的数目,发送请 求的频率和请求的次数。
修改那些默认的 properties。设置 Name 为 MilkRunShowTest, Number of Threads(users)为 X,Ramp-Up Period(in deconds)为 0,Loop Count 为 N。
启动 FirFox 浏览器内存消耗 65% 2.60GB CPU 消耗 3%
测试 32bit 性能测试
进入 WebLogic Console 进行测试,测试开始后内存消耗维持在 65~69%左右(2.60~2.70GB),CPU onsole 页面反应明显变慢,
测试环境
OS:Windows 7-64bit Operating System OS Version:6.1 Processor:Intel(R) Core(TM) i5-25200 CPU@2.5GHz 2.5GHz Installed memory (RAM):4.00GB Myeclipse 9.0M1(支持 64-bit OS) WebLogic Server 11g (10.3.6.0 32bit)
PS:Ramp-Up Period,使用默认值 0 秒。这个 properties 告诉 JMeter 两个 User 开始发送请求之间的延迟时间。例如,输入 10 秒, JMeter 将在 10 秒后启动所有的用户。所以,我们有 10 个用户和 10 秒的 Ramp-up period,那么两个用户之间开始时间的延迟时 1 秒。(10 user/10=1)。如果值为 0,那么 JMeter 将立刻开始你所有的用户操作。
解决方案
查看: commEnv.cmd 配置文件中,对应 64bitOS 的环境 C:\Oracle\Middleware\wlserver\common\bin |commEnv.cmd
64bit OS 时 PATH 对应 x64.设置正确。查看配置环境文件 C:\Oracle\Middleware\wlserver\server\native\win 目录下只有 32bit OS 性能包,下载 64bit 性能包,问题解决。
JDK:Sun jdk1.7.0_05 (64bit) JDK:Sun jdk1.6.0_13 (32bit) 测试条件 重启机器保证无其他软件干扰
重启机器内存消耗 40%维持在 1.60GB
测试准备 启动 Myeclipse 内存消耗 47% 1.85GB
启动 Weblogic Server 内存消耗 58% 2.30GB CPU 消耗 1%
在测试 addNewPurchaseOrder 方法时 CPU 抖动厉害
64bit 性能测试 异常一
在测试 addNewPosition 方法时出现内存溢出异常
解决方案
修改 WebLogic 运行的虚拟内存空间
-Xms512m
-Xmx1024m
-XX:CompileThreshold=8000
-XX:PermSize=128m -XX:MaxPermSize=256m -Xverify:none –da
修改 WebLogic 运行的虚拟内存后异常解决。 错误
测试 addMessage 时出现错误(可运行线程数少于实际线程数)
<BEA‐000402> <There are: 5 active sockets, but the maximum number of socket reader threads allowed by the configuration is: 4. You may want to alter your configuration。
WebLogic 日志出现请求超时记录,CPU 消耗严重,内存消耗维持原
来水平基本不变。
<Dec 21, 2012 10:45:58 AM CST> <Warning> <netuix> <BEA-423420> <Redirect is executed in begin or refresh action. Redirect url is /console/console.portal?_nfpb=true&_pageLabel=AppAutoApplicationOverv iewPage&AppAutoApplicationOverviewPortlethandle=com.bea.console.handl es.AppDeploymentHandle%28%22com.bea%3AName%3D_appsdir_BusinessLogicMi lkrun_dir%2CType%3DAppDeployment%22%29.> <Dec 21, 2012 10:46:06 AM CST> <Warning> <netuix> <BEA-423420> <Redirect is executed in begin or refresh action. Redirect url is /console/console.portal?_nfpb=true&_pageLabel=WebServiceModuleOvervie wPage&WebServiceModuleOverviewPortlethandle=com.bea.console.handles.M oduleHandle%28%22com.bea%3AName%3D_appsdir_BusinessLogicMilkrun_dir%2 CType%3DAppDeployment%3BBusinessLogicMilkrun%3BBusinessLogicMilkrun%3 BOrderServiceService%3BWEBSERVICE%22%29.> <Dec 21, 2012 10:46:13 AM CST> <Warning> <Socket> <BEA-000449> <Closing socket as no data read from it on 0:0:0:0:0:0:0:1:51,022 during the configured idle timeout of 5 secs> <Dec 21, 2012 10:47:08 AM CST> <Warning> <netuix> <BEA-423420> <Redirect is executed in begin or refresh action. Redirect url is /console/console.portal?_nfpb=true&_pageLabel=AppAutoApplicationOverv iewPage&AppAutoApplicationOverviewPortlethandle=com.bea.console.handl es.AppDeploymentHandle%28%22com.bea%3AName%3D_appsdir_BusinessLogicMi lkrun_dir%2CType%3DAppDeployment%22%29.> <Dec 21, 2012 10:47:10 AM CST> <Warning> <netuix> <BEA-423420> <Redirect is executed in begin or refresh action. Redirect url is /console/console.portal?_nfpb=true&_pageLabel=WebServiceModuleOvervie wPage&WebServiceModuleOverviewPortlethandle=com.bea.console.handles.M oduleHandle%28%22com.bea%3AName%3D_appsdir_BusinessLogicMilkrun_dir%2 CType%3DAppDeployment%3BBusinessLogicMilkrun%3BBusinessLogicMilkrun%3 BOrderServiceService%3BWEBSERVICE%22%29.>