|
我先把我的问题列出来,恳求各位高手帮忙解答一下,非常感谢:
1、为什么在100到400并发用户数的情况下点击率都维持在170左右保持平稳,此时的应用服务器与oracle服务器的资源(cpu、内存、磁盘I/O)都没有多大变化,只有事务的响应时间会延长,而且线程数会增加,但都没有达到配置的最大值。
2、在500并发用户数时其点击率上升到320左右保持平稳,而且事务相应时间也比3、4百用户数的低?
先介绍一下我的性能测试环境:
一 硬件环境:
weis服务器:8*cpu/8g memory
oralce服务器:16*cpu/32gmemory
二 软件环境:
weis服务器:Linux服务器、tomcat6,ibatis数据库框架
oracle服务器:Linux服务器、11g
三 测试组网环境(都在同一网段下,网络带宽1000兆):
LoadRunner——>weis——>oracle
四 相关配置说明:
tomcat6配置:
1、堆内存设置:JAVA_OPTS='-Xms6553m -Xmx6553m -Xmn2332m'
2、tomcat线程配置:<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="60000"
redirectPort="8443"
maxThreads="500"
minSpareThreads="10"
maxSpareThreads="50"
enableLookups="false"
acceptCount="500"
isableUploadTimeout="true"
URIEncoding="UTF-8" useBodyEncodingForURI="true"/>
weis数据库线程池配置:
1、config.properties:
weis.jdbc.driver=oracle.jdbc.driver.OracleDriver
weis.jdbc.url=jdbcracle:thin192.168.115.63:1521:sczd
weis.jdbc.username=wefound
weis.jdbc.password=mGFtUeOeiRiC
weis.jdbc.initSize=10
weis.jdbc.maxConnSize=10000
weis.jdbc.minIdleSize=3
weis.jdbc.maxIdleSize=50
weis.jdbc.timeout=5000
2、ibatis配置:
<sqlMapConfig>
<settings
cacheModelsEnabled="true"
enhancementEnabled="true"
lazyLoadingEnabled="true"
maxRequests="1000"
maxSessions="3000"
maxTransactions="100"
useStatementNamespaces="true"
statementCachingEnabled="true"
classInfoCacheEnabled="true"
/>
五 case说明:
就是发出一个请求,应用返回一个页面,该操作共有3次select查询,其查询语句如下:
ELECT C.ID as id,NAME as name,DESCRIPTION as
description,FTEMPLATE_ID as templateId,DETAIL_TMPL_ID as
detailTemplateId,DOWNLOAD_TMPL_ID as downloadTemplateId,RSET_ID
as resourceSetId ,PID as parentId, PRODUCT_ID as
productId,WOBJECT_ID as workflowObjectId
FROM WE_P_COLUMN C,WE_W_OBJECT W
WHERE C.WOBJECT_ID = W.ID AND W.STATUS_ID = 5 AND C.ID = 33;
select ID as ID,NAME as name,author as author,
intro as intro,coversmall as coverSmallId,
coverlarge as coverLargeId,GRADE AS grade
from (SELECT rownum rn,B.*
FROM (SELECT book.ID as ID,book.NAME as name,book.author as author,
book.intro as intro,book.cover_small as coverSmall,
book.cover_large as coverLarge,book.GRADE AS grade,SEQ as
seq,ADD_TIME as addTime,UPDATE_TIME as updateTime
FROM WE_R_SET_RESOURCE rb,WE_R_BOOK book where rb.RESOURCE_ID = book.ID
AND SET_ID = 9 AND STATUS = 0 and XEB_STATUS = 2
order by updateTime desc ) B
where 20>=rownum) c where rn > 0;
SELECT ID as id,FILENAME as filename,MIMETYPE as
mimeType,DESCRIPTION as description,RID as resourceId,FILETYPE AS fileType
FROM WE_R_ATTACHMENT
WHERE ID = 202;
性能测试脚本如下:
Action()
{
/*web_reg_find("Text=putong5xingjituijtushu",
LAST);*/
//lr_think_time(1);
//lr_start_transaction("33");
web_url("s.do",
"URL=http://192.168.115.52:8080/weis/s.do?p=1&c=33&j=l",
"Resource=1",
"RecContentType=text/vnd.wap.wml",
"Referer=",
"Snapshot=t1.inf",
LAST);
//lr_end_transaction("33", LR_AUTO);
return 0;
}
七 性能监控过程:
1、测试场景设置:总共1000个用户并发,每10分钟增加100个用户。
2、初始状态下weis服务器使用情况:
[root@BJ-CP-7F-115-52 /]# vmstat 5
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 204344 6031056 84384 1542732 0 0 0 1 0 0 1 0 99 0 0
0 1 204344 6031876 84404 1542728 0 0 0 28 1007 98 0 0 100 0 0
0 0 204344 6032384 84424 1542732 0 0 0 6 1005 102 0 0 100 0 0
[root@BJ-CP-7F-115-52 /]# ps -eLf|grep java |wc;netstat -an |grep 1521|grep ESTABLISHED|wc
28 632 13866
0 0 0
初始状态下oracle服务器使用情况:
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 340 7711772 735228 15734868 0 0 0 168 1023 387 0 0 100 0 0
0 0 340 7705340 735228 15734868 0 0 0 140 1022 386 0 0 100 0 0
0 0 340 7705356 735228 15734868 0 0 0 84 1013 380 0 0 100 0 0
2.100个用户并发操作weis服务器:
[root@BJ-CP-7F-115-52 /]# vmstat 5
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
r b swpd free buff cache si so bi bo in cs us sy id wa st
6 0 204344 4330860 84648 1543056 0 0 0 51 20326 25630 49 7 43 0 0
11 0 204344 4132800 84656 1543472 0 0 0 79 22557 29875 35 9 57 0 0
5 0 204344 3890124 84664 1543780 0 0 0 97 23139 30723 35 9 56 0 0
java线程与oracle数据库链接情况(没有达到所设置的最大值)
[root@BJ-CP-7F-115-52 /]# ps -eLf|grep java |wc;netstat -an |grep 1521|grep ESTABLISHED|wc
142 3254 72120
100 600 8900
磁盘io使用情况,比较低:
[root@BJ-CP-7F-115-52 /]# iostat 5
avg-cpu: %user %nice %system %iowait %steal %idle
32.38 0.00 8.97 0.05 0.00 58.60
avg-cpu: %user %nice %system %iowait %steal %idle
33.08 0.00 9.12 0.10 0.00 57.70
orcle数据库服务器:
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
r b swpd free buff cache si so bi bo in cs us sy id wa st
6 0 340 7236132 735232 15735180 0 0 0 105 17720 35861 10 6 83 0 0
6 0 340 7236768 735232 15735180 0 0 0 106 17735 35827 10 6 83 0 0
3 0 340 7243348 735232 15735200 0 0 0 73 17901 34630 10 6 84 0 0
[root@BJ-CP-7F-115-63 proc]# iostat 5
avg-cpu: %user %nice %system %iowait %steal %idle
10.01 0.00 6.14 0.01 0.00 83.84
avg-cpu: %user %nice %system %iowait %steal %idle
10.11 0.00 6.49 0.01 0.00 83.39
Controller性能结果:每秒点击率时170左右,事务响应时间是:0.5秒左右,单个操作其数据库处理的时间占99%以上。
2.200个用户(或者3百、4百)并发情况weis:
[root@BJ-CP-7F-115-52 /]# vmstat 5
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
r b swpd free buff cache si so bi bo in cs us sy id wa st
4 0 204344 3343212 87152 1640000 0 0 0 75 23300 30966 33 9 58 0 0
4 0 204344 3341964 87156 1640316 0 0 0 102 23120 30643 32 9 59 0 0
[root@BJ-CP-7F-115-52 /]# ps -eLf|grep java |wc;netstat -an |grep 1521|grep ESTABLISHED|wc
342 7854 174320
298 1788 26522
[root@BJ-CP-7F-115-52 /]# iostat 5
avg-cpu: %user %nice %system %iowait %steal %idle
33.12 0.00 9.05 0.10 0.00 57.73
avg-cpu: %user %nice %system %iowait %steal %idle
32.37 0.00 8.77 0.02 0.00 58.84
oracle数据库:
[root@BJ-CP-7F-115-52 /]# vmstat 5
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
r b swpd free buff cache si so bi bo in cs us sy id wa st
5 0 340 6285924 735260 15736512 0 0 0 67 17705 34621 10 6 84 0 0
3 0 340 6286568 735264 15736512 0 0 0 61 17658 34277 10 6 84 0 0
4 0 340 6280104 735264 15736512 0 0 0 62 17680 35975 10 6 84 0 0
[root@BJ-CP-7F-115-63 proc]# iostat 5
avg-cpu: %user %nice %system %iowait %steal %idle
9.99 0.00 6.11 0.00 0.00 83.90
avg-cpu: %user %nice %system %iowait %steal %idle
10.20 0.00 6.19 0.01 0.00 83.60
200用户并发Controller监控结果:在100至400用户并发情况下,与100用户并发时相关资源使用情况都差不多,而且点击率也是维持在170左右,但每增加100并发用户数相应的线程数、数据库连接数会增加100个左右,而且事务响应时间都响应的延长,如200并发用户数事务相应时间为1.2秒左右,400并发用户数的事务响应时间为2.5秒左右 |
|