All threads (200) are currently busy解决方案

2011年1月22日

高级性能测试人员技能

1.    开发知识:

n         至少熟练掌握一门面向对象编程语言(例如C#),熟悉2门或者多门语言(具体需要熟悉哪些语言,可以根据项目情况在做决定)。

n         至少掌握两门脚本语言,在Windows平台下掌握VBScript(简单易学,对测试来讲很实用),在Linux平台下掌握Perl

2.    数据库知识:

n         至少熟练掌握一个数据库相关性能调优和管理,要到中级DBA水平(推荐是Oracle数据库),了解MySql或者SqlServer数据库。

3.    操作系统:

n         至少熟练掌握Linux操作系统的性能调优和管理,要达到中级系统管理水平(推荐RedHat Linux操作系统)。了解其他的Unix操作系统

n         网络知识:

n         熟悉掌握TCP/IP协议,

4.    测试知识:

n         至少掌握两个性能测试工具,一个是Windows平台,另一个是Linux平台:LoadRunnerhttp_load等。

n         熟悉相关的测试理论知识。

5.    软件工程:

n         掌握UML、设计模式、开发模式等至少

6.    行业知识:

n         了解项目所在的行业知识

 

说明相关知识会将继续添加。。。

 

posted @ 2011-01-22 19:32 小糊涂仙 阅读(14) | 评论(0) | 编辑

2010年1月16日

Elearning性能测试总结报告

Elearning性能测试总结报告

一、     项目情况 

项目名称

Elearning

调优过程

定位出应用程序存在非线程安全代码

DBA 定位到未加绑定变量的SQL以及为数据库增加索引

增加jboss  ajp connector 线程数

调整jvm 参数

调整DBCP 连接池参数

调高 log4j日志阀值减少IO

 

 

 

问题积累

在已经满足性能情况下, 服务器硬件充足,但web server层错误频率高

 

最终结论

耗费在增加http header、定位非线程安全以及dbcp连接参数不当时间最昂贵。本次性能测试与调优涉及多个层面,定位性能瓶颈依赖平常的知识积累,只要拆分模块得当,定位瓶颈有模式可以遵循。为了排查瓶颈是否在数据库要DBA协助。

 

另外,碰到问题,google是一流的帮手!

 

资源消耗

历时2周

 

二、     执行中问题与解决方案

I类问题(已解决):

编号

问题描述

解决方法

1

手工执行功能成功,但vugen执行脚本服务器响应返回0字节

利用嗅探器ethereal发现手工执行与vugen执行脚本的差异,增加web_add_auto_header("modeltype","model");

 

解决问题后,经咨询东软开发工程师,服务器端解析输入代码有

 if ("model".equals(webRequest.getHeader("ModelType")))
判断

 

2

Contoller  Insufficient records for param X  in table to provide the Vuser with unique data

删除根盘目录 Local Settings/Temp下文件,排除干扰

3

并发执行时,发现服务器随机错误,确认有非线程安全代码

在客户端、服务器端分别用嗅探器(fiddler , ethereal, tcpdump )确认发包、收包的状况,确认发包正确,服务器HttpRequest接收到的包也正确。故程序出现在内部变量未做到线程同步

 

4

Apache  error_log :  [error] server reached MaxClients setting, consider raising the MaxClients setting

 

在httpd.conf增加:

StartServers 10

MinSpareServers 10

MaxSpareServers 15

ServerLimit 3000

MaxClients 2000 

MaxRequestsPerChild 10000

KeepAliveTimeout 30

 

并重启httpd服务

 

5

java.lang.OutOfMemoryError: PermGen space、

java.lang.OutOfMemoryError: unable to create new native

 

 

调整JVM,增加堆、栈控制等参数。最终

Run.conf:

 

JAVA_OPTS="-Xms1536m -Xmx1536m  -XX:PermSize=512m -XX:MaxPermSize=512m -Xss256k  -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"

 

 

6

jboss server.log有All threads (200) are currently busy, waiting. Increase maxThreads (200) or check the servlet status

 

Apache通过mod_jk1.2 转发http 请求给jboss。

故修改 jboss-4.0.5.GA/server/default/deploy/server.xml

调整ajp connector 设置:

 

<!-- A AJP 1.3 Connector on port 8009 -->

      <Connector port="8009" address="${jboss.bind.address}" backlog="1200"

         maxThreads="2100" minSpareThreads="20" maxSpareThreads="50"

         emptySessionPath="true" enableLookups="false" redirectPort="8443"

         protocol="AJP/1.3"/>

 

同时在linux  的.bash_profile  增加文件句柄:  ulimit  -n  4096

 

 

7

ORA-00020: maximum number of processes (600) exceeded

   利用oracle statspack以及检查wait event,没有发现数据库方面有阻塞!故定位到连接池参数配置不当导致异常。

更改apache dbcp连接池参数,防止连接leak 。

<set property="removeAbandoned" value="true"/>

                                <set property="removeAbandonedTimeout" value="60"/>

                                <set property="logAbandoned" value="true"/>

 

8

调整log4j  日志级别

在jboss-4.0.5.GA/server/default/conf/log4j.xml

增加日志输出阀值:

 

<param value="ERROR"/>

 

 

II类问题(未解决):

编号

问题描述

规避方案

1

 

 

 

 

 

III类问题(遗留):

编号

问题描述

遗留原因

1

在已经满足性能情况下, 服务器硬件充足,但web server层应用代码大量错误

 

已经满足性能。建议采用tptp 、jprofiler或者JRockit Mission Control 之类工具定位热点方法

 

 

 

 

三、     技术拓展

调优用到的资料参考: 

1 Apache Tomcat Configuration Reference  http://tomcat.apache.org/tomcat-5.5-doc/config/ajp.html 

2  OutOfMemoryExceptionWhenRedeploying  http://wiki.jboss.org/wiki/Wiki.jsp?page=OutOfMemoryExceptionWhenRedeploying 

3   Preventing dB connection pool leaks  

http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html 

4 Apache Performance Tuning  

http://httpd.apache.org/docs/2.0/misc/perf-tuning.html  

5    Tuning Garbage Collection with the 5.0 Java[tm] Virtual Machine 

http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html

 

posted @ 2010-01-16 15:36 小糊涂仙 阅读(1116) | 评论(0) | 编辑

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值