??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲精品国产综合久久一线,国产亚洲综合一区二区三区,亚洲国产精品日韩在线观看http://www.tkk7.com/tacy/category/25670.htmlzh-cnTue, 24 Jun 2008 14:11:38 GMTTue, 24 Jun 2008 14:11:38 GMT60oracle 的lob & longhttp://www.tkk7.com/tacy/archive/2008/06/24/210200.htmltacy leetacy leeMon, 23 Jun 2008 17:18:00 GMThttp://www.tkk7.com/tacy/archive/2008/06/24/210200.htmlhttp://www.tkk7.com/tacy/comments/210200.htmlhttp://www.tkk7.com/tacy/archive/2008/06/24/210200.html#Feedback0http://www.tkk7.com/tacy/comments/commentRss/210200.htmlhttp://www.tkk7.com/tacy/services/trackbacks/210200.html一直认为lobcd的性能要好qlongQ但是之前只了解到l(f)ong的种U限Ӟoracle也是不推荐用longcdQ这几天׃一个项目问题,产品里面一个表字段用了longcdQ分析下来操作long的时候,性能有所影响Q想把它Ҏ(gu)lobQ就单验证了一?/p>

首先创徏两个试表:(x)

create table test_long (a int primary key,b long);
create table test_clob (a int primary key,b clob);

用附件java代码Q往两个表里面各插入100条数据,保证插入数据是一L(fng)Qlob字段长度?0kQ如果小?kQoracle可以把它保存到到表内Q不?x)存储在表外Q性能没有问题Q这个我基本定Q而且我们应用中这个字D늻怼(x)过4kQ?

做一个简单查询对比一下:(x)

SQL> set autotrace traceonly;
SQL> select * from test_clob where a=1;

l计信息
----------------------------------------------------------
        331  recursive calls
          0  db block gets
         69  consistent gets
          4  physical reads
          0  redo size
       1278  bytes sent via SQL*Net to client
        837  bytes received via SQL*Net from client
          5  SQL*Net roundtrips to/from client
         12  sorts (memory)
          0  sorts (disk)
          1  rows processed

SQL> select * from test_long where a=1;

l计信息
----------------------------------------------------------
        236  recursive calls
          0  db block gets
         43  consistent gets
          0  physical reads
          0  redo size
        675  bytes sent via SQL*Net to client
        531  bytes received via SQL*Net from client
          3  SQL*Net roundtrips to/from client
          5  sorts (memory)
          0  sorts (disk)
          1  rows processed

Ҏ(gu)一下,long开销比lob,当然你可以把lob字段启用~存Q把4ơ物理读LQ但q是多了Q?3-43Q次逻辑读,update也试了一下,lob产生的redo比long大,׃列出来了Q有兴趣的可以自p?

试下来Q看来之前的认识不对Q不定的东西最好还是动手试试,当然对于新应用,q是不徏议用longQ毕竟oracle已经废弃它了?

testClobLong.java



tacy lee 2008-06-24 01:18 发表评论
]]>
通过保存错误面到日志中解决一些后台看不到异常的错?/title><link>http://www.tkk7.com/tacy/archive/2008/05/28/203659.html</link><dc:creator>tacy lee</dc:creator><author>tacy lee</author><pubDate>Wed, 28 May 2008 15:05:00 GMT</pubDate><guid>http://www.tkk7.com/tacy/archive/2008/05/28/203659.html</guid><wfw:comment>http://www.tkk7.com/tacy/comments/203659.html</wfw:comment><comments>http://www.tkk7.com/tacy/archive/2008/05/28/203659.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.tkk7.com/tacy/comments/commentRss/203659.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/tacy/services/trackbacks/203659.html</trackback:ping><description><![CDATA[<p>有时候,我们可能希望看到l(f)r的出错页面:(x)比如lr出错Q但是后台服务器没有错误日志Q这时候,我们希望能看到错误页面的内容来判断问题出在什么地方,但是lr没有提供cM的功? </p> <p>我们可以通过一U变通的办法来实玎ͼ(x) </p> <p>首先扑ֈ你出错的面Q保存该面到参数里面:(x) </p> <p>web_set_max_html_param_len(“2048”); </p> <p>web_reg_save_param(“FILED”,”LB=”,”RB=”,”Search=Body”,LAST); </p> <p>然后输出到日志里面:(x) lr_output_message(”#######################################%s”,lr_eval_string(”{FILED}”)); </p> <p>修改lr run-time的几个设|:(x) </p> <p>1、Always send messages </p> <p>2、continue on error Q这h能保证运行lr_output_message) </p> <p>q样lr?x)把所有的lr_output_message输出保存到日志文? </p> <p>当然你不要下载资源文Ӟ否则保存到的׃是html面了,可能是一个gif :( </p> <p>最后,l合lr controller的错误信息,定位到出错的vuser idQ查看该vuser的log文gp看到错误面? </p> <p>非常有效的一个小技巧,用它解决了一个难~的问题?</p> <img src ="http://www.tkk7.com/tacy/aggbug/203659.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/tacy/" target="_blank">tacy lee</a> 2008-05-28 23:05 <a href="http://www.tkk7.com/tacy/archive/2008/05/28/203659.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ibm jdk 1.5~省用的gc{略性能很差http://www.tkk7.com/tacy/archive/2008/04/14/192909.htmltacy leetacy leeMon, 14 Apr 2008 12:38:00 GMThttp://www.tkk7.com/tacy/archive/2008/04/14/192909.htmlhttp://www.tkk7.com/tacy/comments/192909.htmlhttp://www.tkk7.com/tacy/archive/2008/04/14/192909.html#Feedback2http://www.tkk7.com/tacy/comments/commentRss/192909.htmlhttp://www.tkk7.com/tacy/services/trackbacks/192909.html
后面再重新测试的时候,加上了gc logQ用gc分析工具分析了一下gc的吞吐量Q发现吞吐量奇低Q竟然只?7%左右Q很是奇怪,看了一下gc日志Q所有都是global gcQ?怀疑gc{略有问题,查了一下资料,参考了下面一文章:(x)  阅读全文

tacy lee 2008-04-14 20:38 发表评论
]]>
q发是啥http://www.tkk7.com/tacy/archive/2008/03/18/187015.htmltacy leetacy leeTue, 18 Mar 2008 07:33:00 GMThttp://www.tkk7.com/tacy/archive/2008/03/18/187015.htmlhttp://www.tkk7.com/tacy/comments/187015.htmlhttp://www.tkk7.com/tacy/archive/2008/03/18/187015.html#Feedback0http://www.tkk7.com/tacy/comments/commentRss/187015.htmlhttp://www.tkk7.com/tacy/services/trackbacks/187015.html一个用L(fng)d是一个用戯求,一个webservicecM的调用也一个请求,{等


一个用户在某个旉点上当然只能发v一个用戯求,一个用戯求就是一个ƈ?br>

我们一般纠~在同一事物q发q是不同事务q发?br>

可能在一个时间点上,?00个用户在发送浏览,查询动作Q?0个用户在下订单,5个用户在做付?gu)Ƒ֊作,你说q个旉点上有多个q发hQ当然是115个了

衡量一个系l性能主要靠的是q个吞吐量(tpsQ?br>

当然我们也非常关心同?00个用户ƈ发下订单的时候系l是否能支撑Q这是通常我们大部分h理解的ƈ发)Q我们会(x)说这是核心业务,我们要得出数据(是否要考虑背景业务呢,呵呵Q很难说的清楚,我一般就不考虑Q?/p>

tacy lee 2008-03-18 15:33 发表评论
]]>
工作日志-OOM事ghttp://www.tkk7.com/tacy/archive/2008/03/16/186666.htmltacy leetacy leeSun, 16 Mar 2008 14:38:00 GMThttp://www.tkk7.com/tacy/archive/2008/03/16/186666.htmlhttp://www.tkk7.com/tacy/comments/186666.htmlhttp://www.tkk7.com/tacy/archive/2008/03/16/186666.html#Feedback2http://www.tkk7.com/tacy/comments/commentRss/186666.htmlhttp://www.tkk7.com/tacy/services/trackbacks/186666.html某项目,q前开始报OOMQ频率保持在一月一ơ,发生OOM的时候,heap free sizeq有7?00MQ比较奇怪,q后pȝ上集,pȝ发生OOM的频率开始变得频J,基本?-5天,׃用的是sun jdk 1.4.2_08Q无法获取到heap dumpQ徏议用户升U到1.4.2_14Q该版本以后sund了HeapDumpOnOutOfMemoryError参数Q便于获取dump帮助诊断该类问题Q,4天之后,我们获取Cheapdump文gQ通过对dump的分析,基本上排除了对象泄漏?/p>

Ҏ(gu)环境Q?4bit Solaris + 32bit JDKQ,客户把Heap最大设|ؓ(f)2GQ开始怀?2bit JDK无法分配q么大的HeapQ经q验证,不存在这L(fng)问题Qsun|站也有相关说明Q在solaris 64bitpȝ上,32bit jdk最大可以设|到4GQ?/p>

但是从dump看到application classes loader大小已经C60M以上Q有Ҏ(gu)疑Perm|太导_(d)查了一下sun的文档,Perm区缺省大ؓ(f)64MQ估计是应用加蝲太多classesDPerm区溢出,

我们也简单模拟了一下Perm溢出Q强制设|max perm大小?2MQƈ对GCq行了监控,l果和我们预想的一_(d)看下面的gc logQ?

151.836: [Full GC 151.836: [Tenured: 25735K->25736K(1048576K), 0.8380858 secs] 25911K->25736K(1557568K), [Perm : 32767K->32767K(32768K)], 0.8382804 secs]
152.676: [Full GC 152.676: [Tenured: 25736K->25722K(1048576K), 0.8464782 secs] 25752K->25722K(1557568K), [Perm : 32767K->32766K(32768K)], 0.8466638 secs]
153.525: [Full GC 153.525: [Tenured: 25722K->25724K(1048576K), 0.8419056 secs] 25738K->25724K(1557568K), [Perm : 32767K->32767K(32768K)], 0.8420986 secs]
154.368: [Full GC 154.368: [Tenured: 25724K->25724K(1048576K), 0.8398816 secs] 25724K->25724K(1557568K), [Perm : 32767K->32767K(32768K)], 0.8400498 secs]
155.212: [Full GC 155.212: [Tenured: 25724K->25725K(1048576K), 0.8365448 secs] 25788K->25725K(1557568K), [Perm : 32767K->32767K(32768K)], 0.8367370 secs]
156.050: [Full GC 156.050: [Tenured: 25725K->25722K(1048576K), 0.8422488 secs] 25725K->25722K(1557568K), [Perm : 32767K->32766K(32768K)], 0.8424328 secs]
156.895: [Full GC 156.895: [Tenured: 25722K->25724K(1048576K), 0.8443532 secs] 25738K->25724K(1557568K), [Perm : 32767K->32767K(32768K)], 0.8445450 secs]
157.740: [Full GC 157.741: [Tenured: 25724K->25724K(1048576K), 0.8427754 secs] 25740K->25724K(1557568K), [Perm : 32767K->32767K(32768K)], 0.8429634 secs]
158.587: [Full GC 158.588: [Tenured: 25724K->25726K(1048576K), 0.8352290 secs] 25820K->25726K(1557568K), [Perm : 32767K->32767K(32768K)], 0.8354212 secs]
159.424: [Full GC 159.424: [Tenured: 25726K->25723K(1048576K), 0.8435336 secs] 25726K->25723K(1557568K), [Perm : 32767K->32766K(32768K)], 0.8437092 secs]
160.270: [Full GC 160.270: [Tenured: 25723K->25725K(1048576K), 0.8477722 secs] 25739K->25725K(1557568K), [Perm : 32767K->32767K(32768K)], 0.8479596 secs]
161.119: [Full GC 161.119: [Tenured: 25725K->25725K(1048576K), 0.8543338 secs] 25725K->25725K(1557568K), [Perm : 32767K->32767K(32768K)], 0.8545040 secs

从日志看Q和我们现场的状况非常相|heapI间充Q但是perm已经C32MQ无法再q一步分配空_(d)直接Djvm频繁做Full GCQ控制台也开始抛出OOMQPerm引v的回攉是full gcQ,q样看基本我们判断是Perm太小Q导致无法加载classesD?

和客h通之后,我们本来打算q一步验证(在生产环节打开PrintGCDetailQ获取详l的GC logQ,后面仔细查nohup.out,发现里面已经抛出?OutOfMemoryError:PermGen SpaceQ至此我们确定是Perm讄不合理导致了本次事故Q和客户认之后Q我们在启动参数中加上了MaxPermSize

后面惛_中间上了集群之后Qeos加蝲了大量的jboss cache classQ这也直接解释了Z么这D|间OOM出现的频率比之前更频J的原因

q里ȝ一下,希望对碰到类似问题的tx有借鉴意义Q强烈徏议用sun jdk 1.4.2的同学升U到>=1.4.2_12Q便于对OOM问题的诊断,q加上GC log协助验证?

q里再介l一下JVM发生OOM的几U情况:(x)

1、java.lang.OutOfMemoryError: Java heap space

q是我们q_理解的OOMQ是׃heap space实没有I间分配Q这U一般是׃内存泄漏DQ也有可能是heap space讄太小。需要具体分?

2、java.lang.OutOfMemoryError: PermGen space

jvm规范里面有定义一个method spaceQ这里主要放classes和method list和一个string poolQstring有一个internҎ(gu)Q通过q个Ҏ(gu)定义的string都放在这里(好像不常用)Q这里设|不太小?x)导致OOMQ缺?4MQ主要由于现在应用依赖的W三方类来多Q导致这c问题频J发生,需要引起重?

3、Requested array size exceeds VM limit
q种是由于申L(fng)array size出了heap space大小Q比如在一?56M的heap space中申请一?12M的arrayQ这U基本都是应用bugD

4、request <size> bytes for <reason>. Out of swap space?
q种是由于heap size讄相对于系l物理内存太大,Dpȝswap space不Q这U的解决办法是减小heap size大小

5?lt;reason> <stack trace> (Native method)
q种估计是最ȝ的了Q也是最碰到的Q是׃jni或native methodDQ如果自己没有写q类的东西,基本可以说是jdk问题



tacy lee 2008-03-16 22:38 发表评论
]]>
关于oracle中的timestamp和datecdhttp://www.tkk7.com/tacy/archive/2007/12/26/170428.htmltacy leetacy leeTue, 25 Dec 2007 16:42:00 GMThttp://www.tkk7.com/tacy/archive/2007/12/26/170428.htmlhttp://www.tkk7.com/tacy/comments/170428.htmlhttp://www.tkk7.com/tacy/archive/2007/12/26/170428.html#Feedback0http://www.tkk7.com/tacy/comments/commentRss/170428.htmlhttp://www.tkk7.com/tacy/services/trackbacks/170428.html
下面单做一个验证:(x)

c:>sqlplus / as sysdba
sys@EOS >create table test as select table_name,to_timestamp(last_analyzed) date_test from dba_tables;

表已创徏?br />
sys@EOS> create index idx_test_date on test (date_test);

索引已创建?br />
sys@EOS> desc test
 名称                                                  是否为空? cd
 ----------------------------------------------------- -------- ----------------
--------------------
 TABLE_NAME                                            NOT NULL VARCHAR2(30)
 DATE_TEST                                                      TIMESTAMP(0)

sys@EOS> select date_test from test where date_test > TO_DATE('2007-11-5 00:00:00','yyyy-MM-dd HH24:mi:ss');

执行计划
----------------------------------------------------------
Plan hash value: 944171586

-------------------------------------------------------------------------------- --
| Id  | Operation        | Name          | Rows  | Bytes | Cost (%CPU)| Time |
-------------------------------------------------------------------------------- --
|   0 | SELECT STATEMENT |               |     1 |    22 |     1   (0)| 00:00:01 |
|*  1 |  INDEX RANGE SCAN| IDX_TEST_DATE |     1 |    22 |     1   (0)| 00:00:01 |
-------------------------------------------------------------------------------- --

Predicate Information (identified by operation id):
---------------------------------------------------

   1 - access("DATE_TEST">TIMESTAMP'2007-11-05 00:00:00')

Note
-----
   - dynamic sampling used for this statement


l计信息
----------------------------------------------------------
          7  recursive calls
          0  db block gets
         18  consistent gets
          0  physical reads
          0  redo size
        280  bytes sent via SQL*Net to client
        374  bytes received via SQL*Net from client
          1  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          0  rows processed

从上面可以清楚看刎ͼtimestamp>date情况下,走烦?br />
U正我之前的认识?br />
另外再补充一下,dateq个数据cd一般情况下很少用,产品里面所有的date数据cd全部改ؓ(f)timestamp



tacy lee 2007-12-26 00:42 发表评论
]]>
Websphere到底是否需要配|IHShttp://www.tkk7.com/tacy/archive/2007/12/13/167494.htmltacy leetacy leeThu, 13 Dec 2007 06:19:00 GMThttp://www.tkk7.com/tacy/archive/2007/12/13/167494.htmlhttp://www.tkk7.com/tacy/comments/167494.htmlhttp://www.tkk7.com/tacy/archive/2007/12/13/167494.html#Feedback6http://www.tkk7.com/tacy/comments/commentRss/167494.htmlhttp://www.tkk7.com/tacy/services/trackbacks/167494.html作者:(x)tacy lee

有用Websphere做过目的h可能都知道,ibm一般都在Websphere前面加一个IHS来做webserverQ据说这h能?x)提?0%左右Q这栯是否有道理呢Q下面我做了一个简单的试来验证:(x)

试环境Q?/p>

gQ?/p>

应用服务器:(x)Dell6600

压力试客户端:(x)自用W记本(T2050 1.6G)

软gQ?/p>

pȝQCentOS 4.4

Websphere 6.0.2.17+IHS6.0.2.17Q部|在同一台机器上Q?/p>

首先配置好Websphere和IHSQ发布一个简单的试应用Q用loadrunner来测试一下不同的l合看看Q录制一个打开首页可以了Q,下面是我的测试数据:(x)

试Ҏ(gu) 每秒处理h?/td> 响应旉 服务器CPU
直接hWebsphere 4600/s 0.013s 28%
通过IHS转发h 6800/s 0.009s 26%

数据昄Q这q不是一点点提升Q竟然快接近50%Q把静态资源放|到IHS中测试了一把,基本和通过IHS转发差不多,E微有些提升Q不q放到IHS中可以方便CacheQEdge Server包括了Caching Proxy componentQ?/p>

 

下面记录一下如何放|静态资源文件到IHS中:(x)

1、打开Plugins中的plugin-cfg.xmlQ修改如下内容:(x)

<UriGroup Name="default_host_eos_URIs">
   <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/*.jsp"/>
   <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/*.do"/>
   <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/eosmgr/*"/>
   <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/axis/*"/>
   <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/axis2/*"/>
   <Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid" Name="/eoshome_deploy/*"/>
</UriGroup>

也可以通过修改WEB-INF下ibm-web-ext.xmi中的fileServingEnabled为falseQ然后重新生成plugin-cfg.xmlQ但是我试了一下好像不好用?/p>

另外WebsphereQfixpacks 5.1.1.17, 6.0.2.25 and 6.1.0.15Q之后的版本lWebcontainer增加了一个自定义参数

com.ibm.ws.webcontainer.disallowAllFileServing

讑֮它ؓ(f)true产生同样的效果(而且他会(x)覆盖ibm-web-ext.xmi中的讄Q?/p>

2、拷贝你的所有资源文件到IHS的Root Directory?/p>

3、重启IHS

del.icio.us Tags: ,,,


tacy lee 2007-12-13 14:19 发表评论
]]>
db2诊断pd?--捕获sql执行情况http://www.tkk7.com/tacy/archive/2007/11/25/162969.htmltacy leetacy leeSun, 25 Nov 2007 06:51:00 GMThttp://www.tkk7.com/tacy/archive/2007/11/25/162969.htmlhttp://www.tkk7.com/tacy/comments/162969.htmlhttp://www.tkk7.com/tacy/archive/2007/11/25/162969.html#Feedback0http://www.tkk7.com/tacy/comments/commentRss/162969.htmlhttp://www.tkk7.com/tacy/services/trackbacks/162969.html作者:(x)tacy lee

在应用用过E中Q我们经怼(x)到应用响应旉很慢Q甚x有响应,但是应用服务器可能ƈ不是很繁忙,cpu利用率也非常低,引vq种状况的原因有很多U,比如环境问题Q应用资源泄漏,数据库原因等{,本文主要是从一ơ应用性能诊断q程来谈谈如何通过数据库诊断应用性能问题?/p>

问题Q?/p>

试q程中发现应用中某个跌{面执行旉比较长,pȝ压力不大Qcpu利用很低Q该面需要从cache中取数据Q第一ơ的时候加载cacheQ从数据库中查询回数据ƈcacheQ?/p>

诊断Q?/p>

面逻辑比较单,我们先用loadrunner模拟q发试一下这个页面,然后再数据库端捕获sql执行情况?/p>

1、打开db2监控开?/p>

#db2 connect to eos
#db2 update monitor switches using statement on
#db2 reset monitor all

2、几分钟之后Q我们收集sqll计快照

#db2 get snapshot for dynamic sql on eos > dysqlstatus.out

现在l计信息已经存放在dysqlstatus.out中,你可以用Q意方便的文本处理工具查看Q我一般用windows上的gvim来处理,打开dysqlstatus.out

Number of executions = 1

Number of compilations = 1
Worst preparation time (ms) = 2
Best preparation time (ms) = 2
Internal rows deleted = 0
Internal rows inserted = 0
Rows read = 2
Internal rows updated = 0
Rows written = 0
Statement sorts = 0
Statement sort overflows = 0
Total sort time = 0
Buffer pool data logical reads = Not Collected
Buffer pool data physical reads = Not Collected
Buffer pool temporary data logical reads = Not Collected
Buffer pool temporary data physical reads = Not Collected
Buffer pool index logical reads = Not Collected
Buffer pool index physical reads = Not Collected
Buffer pool temporary index logical reads = Not Collected
Buffer pool temporary index physical reads = Not Collected
Total execution time (sec.ms) = 0.000377
Total user cpu time (sec.ms) = 0.010000
Total system cpu time (sec.ms) = 0.000000
Statement text = select ACTIVITYDEFID,ACTIVITYINSTID from wfworkitem where

PROCESSINSTID=104199 and CURRENTSTATE = 4

......

单说一下vi中的处理

:g!/Total execution time/d
只保留文本中的sql执行旉Q我们要按照执行旉来排?br>
通过vim的visual功能选择执行旉块({号后面的数字)Q然后排?br> Total execution time (sec.ms) = 0.050590
Total execution time (sec.ms) = 0.000170
Total execution time (sec.ms) = 0.000247
Total execution time (sec.ms) = 0.000292
Total execution time (sec.ms) = 0.000474
Total execution time (sec.ms) = 0.000330
Total execution time (sec.ms) = 0.000348
Total execution time (sec.ms) = 0.000279
Total execution time (sec.ms) = 0.000385
Total execution time (sec.ms) = 0.000296
Total execution time (sec.ms) = 0.000261
Total execution time (sec.ms) = 0.000195
Total execution time (sec.ms) = 0.000226
Total execution time (sec.ms) = 0.000227
Total execution time (sec.ms) = 0.000193
......
:'<,'>!sort

排序后的l果Q部分)
Total execution time (sec.ms) = 2.027776
Total execution time (sec.ms) = 2.203624
Total execution time (sec.ms) = 2.504677
Total execution time (sec.ms) = 2.951256
Total execution time (sec.ms) = 3.119875
Total execution time (sec.ms) = 3.303277
Total execution time (sec.ms) = 3.303517
Total execution time (sec.ms) = 4.017133
Total execution time (sec.ms) = 4.043329
Total execution time (sec.ms) = 4.252125
Total execution time (sec.ms) = 4.400952
Total execution time (sec.ms) = 4.606765
Total execution time (sec.ms) = 5.208087
Total execution time (sec.ms) = 5.778598
Total execution time (sec.ms) = 8.117470
Total execution time (sec.ms)      = 9797.905136

可以看到最长时间的sql total执行旉耗费?797.905123s.

现在我们到dysqlstatus.out中去找这条语?/p>

Number of executions               = 4602
Number of compilations = 4294967295
Worst preparation time (ms) = 2
Best preparation time (ms) = 2
Internal rows deleted = 0
Internal rows inserted = 0
Rows read = 2963688
Internal rows updated = 0
Rows written = 0
Statement sorts = 0
Statement sort overflows = 0
Total sort time = 0
Buffer pool data logical reads = Not Collected
Buffer pool data physical reads = Not Collected
Buffer pool temporary data logical reads = Not Collected
Buffer pool temporary data physical reads = Not Collected
Buffer pool index logical reads = Not Collected
Buffer pool index physical reads = Not Collected
Buffer pool temporary index logical reads = Not Collected
Buffer pool temporary index physical reads = Not Collected
Total execution time (sec.ms) = 9797.905136
Total user cpu time (sec.ms) = 9.290000
Total system cpu time (sec.ms) = 1.230000
Statement text = select * from XXXX_T_CNFACTIVITYDEF

q条语句d执行?602ơ,q_每次的执行时?SQ而且q些数据应该是被cacheh?nbsp;  Q)

ȝQ?/p>

上面的方法简单ȝ了从数据库层面对应用的性能问题诊断Q希望对大家有所帮助Q对于数据库快照诊断问题的思\对于L数据库通用

 

补充一个unix上脚本处理方式:(x)

sqlsort.sh

awk 'BEGIN{RS="";FS="\n";ORS="\n"};/Statement text/{print $1, $21, $24}' $1 | awk '$5 > 0 {print "AvgTime:", $11/$5, "\t", $0}'| sort -n | head -n $2|awk '{print $0, "\n"}'
 
使用Q?sqlsort.sh dysqlstate.out 10Q显CTop tenQ?/div>
 
del.icio.us Tags: ,,,


tacy lee 2007-11-25 14:51 发表评论
]]>db2诊断pd?--定位锁等待问?/title><link>http://www.tkk7.com/tacy/archive/2007/11/24/162892.html</link><dc:creator>tacy lee</dc:creator><author>tacy lee</author><pubDate>Sat, 24 Nov 2007 13:18:00 GMT</pubDate><guid>http://www.tkk7.com/tacy/archive/2007/11/24/162892.html</guid><wfw:comment>http://www.tkk7.com/tacy/comments/162892.html</wfw:comment><comments>http://www.tkk7.com/tacy/archive/2007/11/24/162892.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/tacy/comments/commentRss/162892.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/tacy/services/trackbacks/162892.html</trackback:ping><description><![CDATA[<p>作者:(x)tacy lee</p> <p>在应用中Q我们经怼(x)到sql执行很慢Q但是数据库cpu和内存用率又不高的情况Q类似的问题基本上由于锁Q排序等原因造成Q本文主要描q如何去定位锁等待问题,谁在锁等待?{待谁持有的锁?锁在那个表?</p> <p>一、测试准?/p> <p>1、先在session1执行如下操作Q创建测试表</p> <div><pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">#db2 connect to eos #export DB2OPTIONS=+C #db2 <span style="color: #006080">"create table tacy_test (a int not null primary key,b varchar(10))"</span> #db2 <span style="color: #006080">"insert into tacy_test values(1,'a')"</span> #db2 <span style="color: #006080">"insert into tacy_test values(2,'a')"</span> #db2 <span style="color: #006080">"insert into tacy_test values(3,'a')"</span> #db2 <span style="color: #006080">"insert into tacy_test values(4,'a')"</span> #db2 commit</pre></div> <p>2、在session2执行如下操作</p> <div><pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">#db2 connect to eos #export DB2OPTIONS=+C</pre></div> <p>二、生一个lock wait</p> <p>在session1做一个表更新Q?/p> <div><pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">#db2 <span style="color: #006080">"update tacy_test set b='b' where a=4"</span></pre></div> <div>sql执行成功</div> <div>在session2做同h新操作:(x)</div> <div><pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">#db2 <span style="color: #006080">"update tacy_test set b='c' where a=4"</span></pre></div> <p>q程被挂L(fng)?/p> <p>三、定位锁{待</p> <p>1、先来看看应用的情况Q?/p> <div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; max-height: 200px"><pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">#db2pd -db eos -applications Database Partition 0 -- Database EOS -- Active -- Up 0 days 07:37:37 Applications: Address AppHandl [nod-index] NumAgents CoorPid Status C-AnchID C-StmtUID L-AnchID L-StmtUID Appid 0x10140040 8 [000-00008] 1 8425 Lock-wait 80 2 66 1 *LOCAL.db2inst1.071124043739 0x100CE540 7 [000-00007] 1 8358 UOW-Waiting 0 0 80 2 *LOCAL.db2inst1.071124043708 </pre></div> <p>可以看到有一个应用的状态处于Lock-wait</p> <p>2、现在我们来看看应用在等什?/p> <div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; max-height: 200px"><pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">#db2pd -db eos -locks showlock wait Database Partition 0 -- Database EOS -- Active -- Up 0 days 07:42:56 Locks: Address TranHdl Lockname Type Mode Sts Owner Dur HldCnt Att Rlse 0x2C8E0760 3 02001806078066020000000052 Row ..X W 2 1 0 0 0x0 TbspaceID 2 TableID 1560 RecordID 0x2668007</pre></div> <p>锁的cd为RowQ行锁)QX锁(排他锁)Q下面是我们最兛_的锁的位|?/p> <p>TbspaceID 2 TableID 1560 RecordID 0x2668007</p>其中TbspaceIDI间IDQTableID的IDQRecordID代表具体位置Q全部应该是0x0266807,其中前面三个字节为page numberQؓ(f)0x02668Q后面一个字节代表solt identifierQؓ(f)0x07 <p>3、找到相应的?/p> <div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; max-height: 200px"><pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">#db2 <span style="color: #006080">"select tbspace,tabschema,tabname,tableid,tbspaceid from syscat.tables where tbspaceid=2 and tableid=1560"</span> TBSPACE TABSCHEMA TABNAME TABLEID TBSPACEID ------------ ----------- ---------- ------- --------- USERSPACE1 DB2INST1 TACY_TEST 1560 2 1 record(s) selected. </pre></div> <p>4、根据RecordID扑ֈ锁在哪行</p> <p>db2提供了一个强大的数据分析工具db2dartQ可以dump出相应的page数据</p> <div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; max-height: 200px"><pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">#db2dart eos /dd /tsi 2 /oi 1560 /ps 157312p /np 1 /v y Warning: The database state <span style="color: #0000ff">is</span> not consistent. Warning: Reorg rows MAY be due to the inconsistent state of the database. DB2DART Processing completed with warning(s)! Complete DB2DART report found <span style="color: #0000ff">in</span>: /home/db2inst1/sqllib/db2dump/DART0000/EOS.RPT</pre></div> <p>其中tsiI间id(2)Qoiid(1560)Qps为page number(0x0266807)Q需要{换ؓ(f)十进Ӟ在结ֿdpQnp代表你要获取的页敎ͼv为是否详l输?/p> <p>现在我们来看看EOS.RPT</p> <div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; max-height: 200px"><pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">______________________________________________________________________________ _______ DART _______ D a t a b a s e A n a l y s i s a n d R e p o r t i n g T o o l IBM DB2 6000 ______________________________________________________________________________ DART (V8.1.0) Report: 2007-11-24-20.59.51.355893 Database Name: EOS Report name: EOS.RPT Old report back-up: EOS.BAK Database Subdirectory: /opt/db2/db2inst1/NODE0000/SQL00001 Operational Mode: Database Inspection Only (INSPECT) ______________________________________________________________________________ ------------------------------------------------------------------------------ Action option: DD Table-<span style="color: #0000ff">object</span>-ID: 1560; Tablespace-ID: 2; First-page: 157312p; Number-pages: 1; Verbose: y Warning: The database state <span style="color: #0000ff">is</span> not consistent. Warning: Reorg rows MAY be due to the inconsistent state of the database. Connecting to Buffer Pool Services... Table <span style="color: #0000ff">object</span> report phase start. Dump format <span style="color: #0000ff">is</span> verbose. ______________________________________ Page 0 of <span style="color: #0000ff">object</span> 1560 from table space 2. BPS Page Header: Page Data Offset = 48 Page Data Length = 4048 Page LSN = 0000 AE97 AE41 Object Page Number = 0 Pool Page Number = 157312 Object ID = 1560 Object Type = Data Object Data Page Header: Slot Count = 8 Total Free Space = 2784 Total Reserve Space = 0 Youngest Reserve Space = n/a Youngest TID = n/a Free Space Offset = 2799 Maximum Record Size = 23 Data Records: Slot 0: Offset Location = 3996 (xF9C) Record Length = 32 (x20) Record Type = Data Object Header Control Record Page count = 1 Object Creation LSN = 0000 AE97 800C Object State = x0000 UDI Since Runstats = 0 DART Field = x00000000 Slot 1: Offset Location = 2992 (xBB0) Record Length = 1004 (x3EC) Record Type = Free Space Control Record Free space entries: 0: 2884 (x0B44), 4028 (x0FBC), 4028 (x0FBC), 4028 (x0FBC) 4: 4028 (x0FBC), 4028 (x0FBC), 4028 (x0FBC), 4028 (x0FBC) 8: 4028 (x0FBC), 4028 (x0FBC), 4028 (x0FBC), 4028 (x0FBC) 省略。。? 492: 4028 (x0FBC), 4028 (x0FBC), 4028 (x0FBC), 4028 (x0FBC) 496: 4028 (x0FBC), 4028 (x0FBC), 4028 (x0FBC), 4028 (x0FBC) Slot 2: Offset Location = 2916 (xB64) Record Length = 76 (x4C) Record Type = Table Directory Record MetaIndex Root Page = 157377 Index Type = 2 Table Descriptor Pointer -- Page 157312 Slot 3 Max Insert Search = 0 Flags = x02000200 bit representation = 00000010 00000000 00000010 00000000 Check pending info: Constraint status = x00 Constraint RID = Page 0 Slot 0 last BID = x00000000 Slot 3: Offset Location = 2892 (xB4C) Record Length = 24 (x18) Record Type = Table Description Record Number of Columns = 2 Column 1: Type <span style="color: #0000ff">is</span> Long Integer Length = 4 Prohibits NULLs Prohibits Default Fixed offset: 0 Column 2: Type <span style="color: #0000ff">is</span> Fixed Length Character String Length = 10 Allows NULLs Prohibits Default Fixed offset: 4 Slot 4: Offset Location = 2869 (xB35) Record Length = 23 (x17) Record Type = Table Data Record (FIXEDVAR) Fixed part length <span style="color: #0000ff">value</span> = 15 Column 1: Fixed offset: 0 Type <span style="color: #0000ff">is</span> Long Integer Value = 1 Column 2: Fixed offset: 4 Type <span style="color: #0000ff">is</span> Fixed Length Character String 61202020 20202020 2020 a Slot 5: Offset Location = 2846 (xB1E) Record Length = 23 (x17) Record Type = Table Data Record (FIXEDVAR) Fixed part length <span style="color: #0000ff">value</span> = 15 Column 1: Fixed offset: 0 Type <span style="color: #0000ff">is</span> Long Integer Value = 2 Column 2: Fixed offset: 4 Type <span style="color: #0000ff">is</span> Fixed Length Character String 61202020 20202020 2020 a Slot 6: Offset Location = 2823 (xB07) Record Length = 23 (x17) Record Type = Table Data Record (FIXEDVAR) Fixed part length <span style="color: #0000ff">value</span> = 15 Column 1: Fixed offset: 0 Type <span style="color: #0000ff">is</span> Long Integer Value = 3 Column 2: Fixed offset: 4 Type <span style="color: #0000ff">is</span> Fixed Length Character String 61202020 20202020 2020 a Slot 7: Offset Location = 2800 (xAF0) Record Length = 23 (x17) Record Type = Table Data Record (FIXEDVAR) Fixed part length <span style="color: #0000ff">value</span> = 15 Column 1: Fixed offset: 0 Type <span style="color: #0000ff">is</span> Long Integer Value = 4 Column 2: Fixed offset: 4 Type <span style="color: #0000ff">is</span> Fixed Length Character String 61202020 20202020 2020 a Slots Summary: Total=8, In-use=8, Deleted=0. Table <span style="color: #0000ff">object</span> report phase end. ______________________________________ DB2DART Processing completed with warning(s)! Warning(s) detected during processing. ______________________________________ Complete DB2DART report found <span style="color: #0000ff">in</span>: /home/db2inst1/sqllib/db2dump/DART0000/EOS.RPT _______ D A R T P R O C E S S I N G C O M P L E T E _______</pre></div> <p>扑ֈSolt 7 (0x07)QokQ你现在可以清楚的知道应用等待的Row?4,a)</p> <p> </p> <p>ȝ</p> <p>通过上面的方法,我们单描qC一个db2锁问题的定位Ҏ(gu)Q希望能l大家在分析和定位应用性能问题的时候vC定的帮助</p> <div id="zbbmoec" class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:d4188abc-b1ba-4bf7-8c81-f16c1fedc0c9" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">del.icio.us Tags: <a rel="tag">db2</a>,<a rel="tag">lock</a>,<a rel="tag">tuning</a>,<a rel="tag">diagnostic</a></div><img src ="http://www.tkk7.com/tacy/aggbug/162892.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/tacy/" target="_blank">tacy lee</a> 2007-11-24 21:18 <a href="http://www.tkk7.com/tacy/archive/2007/11/24/162892.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>深入理解Loadrunner中的Browser Emulationhttp://www.tkk7.com/tacy/archive/2007/11/06/158397.htmltacy leetacy leeMon, 05 Nov 2007 16:19:00 GMThttp://www.tkk7.com/tacy/archive/2007/11/06/158397.htmlhttp://www.tkk7.com/tacy/comments/158397.htmlhttp://www.tkk7.com/tacy/archive/2007/11/06/158397.html#Feedback0http://www.tkk7.com/tacy/comments/commentRss/158397.htmlhttp://www.tkk7.com/tacy/services/trackbacks/158397.html作者:(x)tacy lee

一Q基本介l?/strong>

在Loadrunner的用中Q对于Run-time Settings下的browser emulation讄是比较容易让Z生困惑的地方。下面我们结合sniffer来具体看看每个选项的用途,以及(qing)Ҏ(gu)试的影响?

clip_image002

                                               Browser Emulation ?/p>

二:(x)案例和工?/strong>

1. 试案例Q?/b>

打开|站首页两次Q对比不同Browser Emulation讄下loadrunner的行为,脚本如下?

Action()
{
    web_url("www.primeton.com", 
        "URL=http://www.primeton.com/", 
        "Resource=0", 
        "RecContentType=text/html", 
        "Referer=", 
        "Snapshot=t2.inf", 
        "Mode=HTML", 
        LAST);

    web_url("www.primeton.com", 
        "URL=http://www.primeton.com/", 
        "Resource=0", 
        "RecContentType=text/html", 
        "Referer=", 
        "Snapshot=t2.inf", 
        "Mode=HTML", 
        LAST);

    return 0;
}

2. sniffer工具

开源工P(x)Wireshark(前n是ethereal)Qwww.wireshark.orgQ?

三:(x)试q程

Z方便描述Q我们约定用Q?

A代表Simulate browser cache

B代表Cache URLs requiring content(HTMLs)

C代表Check for newer versions of stored pages every visit to the page

D代表Download non-HTML resources

E代表Simulate a new user on each iteratioin

F代表Clear cache on each iteration

首先讄Run Logic中的iteration?。让Actionq行两次Q看看@环运行脚本两ơ,数据包和q接数的变化?

1. L所有选项

l果Q共获取数据?5个,建立q接1个(U色标识Q,断开q接1个(蓝色标识Q?

No.     Time        Source            Destination       Protocol Info
      1 0.000000    192.168.1.61      203.81.29.137     TCP      13835 > http [SYN] Seq=0 Len=0 MSS=1460 WS=2
      2 0.036053    203.81.29.137     192.168.1.61      TCP      http > 13835 [SYN, ACK] Seq=0 Ack=1 Win=17280 Len=0 MSS=1440 WS=0
     92 1.415887    192.168.1.61      203.81.29.137     TCP      13835 > http [FIN, ACK] Seq=817 Ack=71762 Win=257760 Len=0
     94 1.449960    203.81.29.137     192.168.1.61      TCP      http > 13835 [FIN, ACK] Seq=71762 Ack=818 Win=16464 Len=0

在这U情况下Q数据包非常(没有选择下蝲资源文g入css,js,gif{)Q而且你可以看刎ͼ打开4ơ首,只徏立了一个tcpq接?

q时Q你即选择AQ发现数据包的数量量|有变化,因ؓ(f)cache主要q是针对资源文g

2. 选择E(F)

l果Q共获取数据?02个,建立q接2个(U色标识Q,断开q接2个(蓝色标识Q?/p>

No.     Time        Source            Destination       Protocol Info
      1 0.000000    192.168.1.61      203.81.29.137     TCP      13886 > http [SYN] Seq=0 Len=0 MSS=1460 WS=2
      2 0.037013    203.81.29.137     192.168.1.61      TCP      http > 13886 [SYN, ACK] Seq=0 Ack=1 Win=17280 Len=0 MSS=1440 WS=0
     48 0.618117    192.168.1.61      203.81.29.137     TCP      13886 > http [FIN, ACK] Seq=409 Ack=35882 Win=257760 Len=0
     49 0.644106    192.168.1.61      203.81.29.137     TCP      13887 > http [SYN] Seq=0 Len=0 MSS=1460 WS=2
     51 0.651919    203.81.29.137     192.168.1.61      TCP      http > 13886 [FIN, ACK] Seq=35882 Ack=410 Win=16872 Len=0
     53 0.676377    203.81.29.137     192.168.1.61      TCP      http > 13887 [SYN, ACK] Seq=0 Ack=1 Win=17280 Len=0 MSS=1440 WS=0
     99 1.310379    192.168.1.61      203.81.29.137     TCP      13887 > http [FIN, ACK] Seq=409 Ack=35882 Win=257760 Len=0
101 1.347949    203.81.29.137     192.168.1.61      TCP      http > 13887 [FIN, ACK] Seq=35882 Ack=410 Win=16872 Len=0

在这U情况下Q数据包非常(没有选择下蝲资源文g入css,js,gif{)Q对比第一U情况,你会(x)发现它徏立了两个q接Q这是E的作用,它对于每ơP代都当成一个新的用P需要重新徏立连接?

3. 选择DE(F)

l果Q共获取数据?782个,建立q接6个(U色标识Q,断开q接6个(蓝色标识Q?/p>

No.     Time        Source            Destination       Protocol Info
      1 0.000000    192.168.1.61      203.81.29.137     TCP      14016 > http [SYN] Seq=0 Len=0 MSS=1460 WS=2
      2 0.037911    203.81.29.137     192.168.1.61      TCP      http > 14016 [SYN, ACK] Seq=0 Ack=1 Win=17280 Len=0 MSS=1440 WS=0
      6 0.107432    192.168.1.61      203.81.29.137     TCP      14017 > http [SYN] Seq=0 Len=0 MSS=1460 WS=2
      9 0.141816    203.81.29.137     192.168.1.61      TCP      http > 14017 [SYN, ACK] Seq=0 Ack=1 Win=17280 Len=0 MSS=1440 WS=0
    426 3.334889    192.168.1.61      203.81.29.137     TCP      14017 > http [FIN, ACK] Seq=1852 Ack=150284 Win=257484 Len=0
    428 3.372253    203.81.29.137     192.168.1.61      TCP      http > 14017 [FIN, ACK] Seq=150284 Ack=1853 Win=16998 Len=0
    448 4.395488    192.168.1.61      203.81.29.137     TCP      14020 > http [SYN] Seq=0 Len=0 MSS=1460 WS=2
    457 4.439604    203.81.29.137     192.168.1.61      TCP      http > 14020 [SYN, ACK] Seq=0 Ack=1 Win=17280 Len=0 MSS=1440 WS=0
    859 7.593610    192.168.1.61      203.81.29.137     TCP      14016 > http [FIN, ACK] Seq=2849 Ack=377404 Win=257484 Len=0
    870 7.659680    203.81.29.137     192.168.1.61      TCP      http > 14016 [FIN, ACK] Seq=377404 Ack=2850 Win=15935 Len=0
    888 8.511308    192.168.1.61      203.81.29.137     TCP      14020 > http [FIN, ACK] Seq=1602 Ack=208150 Win=257760 Len=0
    890 8.549451    203.81.29.137     192.168.1.61      TCP      http > 14020 [FIN, ACK] Seq=208150 Ack=1603 Win=17280 Len=0
    892 8.566246    192.168.1.61      203.81.29.137     TCP      14022 > http [SYN] Seq=0 Len=0 MSS=1460 WS=2
    893 8.601893    203.81.29.137     192.168.1.61      TCP      http > 14022 [SYN, ACK] Seq=0 Ack=1 Win=17280 Len=0 MSS=1440 WS=0
    899 8.702628    192.168.1.61      203.81.29.137     TCP      14023 > http [SYN] Seq=0 Len=0 MSS=1460 WS=2
    904 8.741807    203.81.29.137     192.168.1.61      TCP      http > 14023 [SYN, ACK] Seq=0 Ack=1 Win=17280 Len=0 MSS=1440 WS=0
   1298 11.809456   192.168.1.61      203.81.29.137     TCP      14022 > http [FIN, ACK] Seq=1550 Ack=159770 Win=257484 Len=0
   1310 11.878665   203.81.29.137     192.168.1.61      TCP      http > 14022 [FIN, ACK] Seq=159770 Ack=1551 Win=17280 Len=0
   1341 12.771707   192.168.1.61      203.81.29.137     TCP      14026 > http [SYN] Seq=0 Len=0 MSS=1460 WS=2
   1348 12.813950   203.81.29.137     192.168.1.61      TCP      http > 14026 [SYN, ACK] Seq=0 Ack=1 Win=17280 Len=0 MSS=1440 WS=0
   1759 16.032952   192.168.1.61      203.81.29.137     TCP      14023 > http [FIN, ACK] Seq=3151 Ack=367918 Win=257484 Len=0
   1761 16.068296   203.81.29.137     192.168.1.61      TCP      http > 14023 [FIN, ACK] Seq=367918 Ack=3152 Win=17280 Len=0
   1779 16.983042   192.168.1.61      203.81.29.137     TCP      14026 > http [FIN, ACK] Seq=1602 Ack=208150 Win=257760 Len=0
   1781 17.016836   203.81.29.137     192.168.1.61      TCP      http > 14026 [FIN, ACK] Seq=208150 Ack=1603 Win=17280 Len=0

在这U情况下Q数据包的数量非常大Q连接也很多Q由于没有cache功能Q每ơ打开面都需要重C载所有的资源文g?

4. 选择ADE

l果Q共获取数据?25个,建立q接3个,断开q接3?不再标识了,syn即ؓ(f)q接hQfin即ؓ(f)断开hQ?/p>

No.     Time        Source            Destination       Protocol Info
      1 0.000000    192.168.1.61      203.81.29.137     TCP      14189 > http [SYN] Seq=0 Len=0 MSS=1460 WS=2
      2 0.033657    203.81.29.137     192.168.1.61      TCP      http > 14189 [SYN, ACK] Seq=0 Ack=1 Win=17280 Len=0 MSS=1440 WS=0
      6 0.100636    192.168.1.61      203.81.29.137     TCP      14190 > http [SYN] Seq=0 Len=0 MSS=1460 WS=2
      9 0.133703    203.81.29.137     192.168.1.61      TCP      http > 14190 [SYN, ACK] Seq=0 Ack=1 Win=17280 Len=0 MSS=1440 WS=0
    429 3.383748    192.168.1.61      203.81.29.137     TCP      14190 > http [FIN, ACK] Seq=1852 Ack=150284 Win=257484 Len=0
    431 3.418556    203.81.29.137     192.168.1.61      TCP      http > 14190 [FIN, ACK] Seq=150284 Ack=1853 Win=16998 Len=0
    471 4.352071    192.168.1.61      203.81.29.137     TCP      14189 > http [FIN, ACK] Seq=1504 Ack=235576 Win=257760 Len=0
    472 4.380312    192.168.1.61      203.81.29.137     TCP      14192 > http [SYN] Seq=0 Len=0 MSS=1460 WS=2
    474 4.389778    203.81.29.137     192.168.1.61      TCP      http > 14189 [FIN, ACK] Seq=235576 Ack=1505 Win=17280 Len=0
    476 4.413220    203.81.29.137     192.168.1.61      TCP      http > 14192 [SYN, ACK] Seq=0 Ack=1 Win=17280 Len=0 MSS=1440 WS=0
    522 5.078068    192.168.1.61      203.81.29.137     TCP      14192 > http [FIN, ACK] Seq=409 Ack=35882 Win=257760 Len=0
524 5.115099    203.81.29.137     192.168.1.61      TCP      http > 14192 [FIN, ACK] Seq=35882 Ack=410 Win=16872 Len=0

在这U情况下Qcache发挥作用Q数据包Ҏ(gu)W三U情况大大减,几乎{于打开一ơ首늚数据量(449个数据包Q,只有W一ơ打开面需要完整下载页面(包括资源文gQ,后面的三ơ打开面都只要下载HTML面Q不包括资源文gQ?

5. 选择ADEF

选择F之后我们看看l果Q共获取数据?42个,建立q接4个,断开q接4?/p>

No.     Time        Source            Destination       Protocol Info
      1 0.000000    192.168.1.61      203.81.29.137     TCP      14292 > http [SYN] Seq=0 Len=0 MSS=1460 WS=2
      2 0.034524    203.81.29.137     192.168.1.61      TCP      http > 14292 [SYN, ACK] Seq=0 Ack=1 Win=17280 Len=0 MSS=1440 WS=0
      6 0.102314    192.168.1.61      203.81.29.137     TCP      14294 > http [SYN] Seq=0 Len=0 MSS=1460 WS=2
      9 0.139752    203.81.29.137     192.168.1.61      TCP      http > 14294 [SYN, ACK] Seq=0 Ack=1 Win=17280 Len=0 MSS=1440 WS=0
    426 3.791111    192.168.1.61      203.81.29.137     TCP      14294 > http [FIN, ACK] Seq=1852 Ack=150284 Win=257484 Len=0
    428 3.824970    203.81.29.137     192.168.1.61      TCP      http > 14294 [FIN, ACK] Seq=150284 Ack=1853 Win=16998 Len=0
    468 6.213276    192.168.1.61      203.81.29.137     TCP      14292 > http [FIN, ACK] Seq=1504 Ack=235576 Win=257760 Len=0
    469 6.244052    192.168.1.61      203.81.29.137     TCP      14297 > http [SYN] Seq=0 Len=0 MSS=1460 WS=2
    471 6.249564    203.81.29.137     192.168.1.61      TCP      http > 14292 [FIN, ACK] Seq=235576 Ack=1505 Win=17280 Len=0
    473 6.279647    203.81.29.137     192.168.1.61      TCP      http > 14297 [SYN, ACK] Seq=0 Ack=1 Win=17280 Len=0 MSS=1440 WS=0
    479 6.374967    192.168.1.61      203.81.29.137     TCP      14298 > http [SYN] Seq=0 Len=0 MSS=1460 WS=2
    484 6.419597    203.81.29.137     192.168.1.61      TCP      http > 14298 [SYN, ACK] Seq=0 Ack=1 Win=17280 Len=0 MSS=1440 WS=0
    897 9.858493    192.168.1.61      203.81.29.137     TCP      14297 > http [FIN, ACK] Seq=1550 Ack=159770 Win=257484 Len=0
    899 9.895188    203.81.29.137     192.168.1.61      TCP      http > 14297 [FIN, ACK] Seq=159770 Ack=1551 Win=17280 Len=0
    939 12.840029   192.168.1.61      203.81.29.137     TCP      14298 > http [FIN, ACK] Seq=1806 Ack=226090 Win=257760 Len=0
    941 12.876120   203.81.29.137     192.168.1.61      TCP      http > 14298 [FIN, ACK] Seq=226090 Ack=1807 Win=17076 Len=0

在这U情况下Q由于选择了FQ在q代的时候清除了cacheQ所以每ơP代都需要重C载资源文件。数据包差不多等于第三种情况的一半,U等于打开两次首页的数据量Q?49×2个数据包Q?

6. 关于BC选项

C的解释(Check for newer versions of stored pages every visit to the pageQ?/i>

C比较Ҏ(gu)理解Q类似IE讄中的每次查,如果不设|CQLR对于已经cache的文件就不会(x)重新向服务器hQ如果选择CQ你可以在数据包中发现很多304信息?

B的解释(Cache URLs requiring content(HTMLs)Q?/i>

LR对于资源文g的cacheq不?x)真正cache在内存中或者在盘上,q个选项表示Q对于一些需要用到的兌Q校验,面解析内容真正cache在内存中Q减客L(fng)的重复工作?

当然如果你想把GIF也cache到内存中Q你可以在Advanced中设|,选择Specify URL requiring content in addition to HTML pagesQ加入条目image/gifQƈN。当Vuserq行的时候,你可以对比一下mmdrv.exeq程的内存消耗(内存占用?x)更多)?

四:(x) l论

通过上面的测试分析,我们大概知道了每个选项的真正含义,你需要根据你的测试目的来选择合适的讄Q?

1?对于一个具体的应用试Q对于前端Web Server不可忽略Q缺省设|非常合适,不需要调_(d)有时候需要考虑把C选上Q?

注意Q很多h在录制脚本的时候,?fn)惯把登入操作放到vuser_init中,q时候缺省设|可能会(x)抛错Q徏议把q类的操作都攑օ到action?

2?如果你更x后端应用服务器的性能或者说做一些架构的验证分析Q那你缺省设|对于你来说׃合适了Q你需要选择取消所有的讄V?

当然你也可以Ҏ(gu)自己的具体情况做不同调整Q但是一定要真正理解q些选项的具体含义才能做C犯错?/p>

del.icio.us Tags: , ,


tacy lee 2007-11-06 00:19 发表评论
]]>
一ơ支持日?/title><link>http://www.tkk7.com/tacy/archive/2007/10/30/156908.html</link><dc:creator>tacy lee</dc:creator><author>tacy lee</author><pubDate>Tue, 30 Oct 2007 05:09:00 GMT</pubDate><guid>http://www.tkk7.com/tacy/archive/2007/10/30/156908.html</guid><wfw:comment>http://www.tkk7.com/tacy/comments/156908.html</wfw:comment><comments>http://www.tkk7.com/tacy/archive/2007/10/30/156908.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/tacy/comments/commentRss/156908.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/tacy/services/trackbacks/156908.html</trackback:ping><description><![CDATA[<p>故障现象Q?/p> <p>试一D|间后应用无响应,q接池不能放大,jvm crashQ日志报对象分配p|</p> <p> </p> <p>问题诊断Q?/p> <p>W一个阶D|websphere问题</p> <p>到现Z后,回放脚本试几分钟,应用开始无法响应,后台也没有异常,update jdk之后Q系l能正常响应了,但是发现新的问题Qdb2q接池始l无法放大,最大只能到30Q而且pȝ也会(x)抛OOMQ导致系l异常推出,从系l日志看Q是因ؓ(f)应用中的大对象分配导致的Q?M大小Q?/p> <p>期间Q关于连接池无法攑֤问题想了很多办法Q包括修改db2 maxappls,maxagentsq些参数Q更新数据库驱动Q而且定不是db2的问题(在创?0之后Q我们依然可以通过其他方式q接到db2Q说明db2的连接限制确实放大了Q,当然我们productdatasourceq个池子大小我已l放大到100了?/p> <p>中间q发现测试脚本没有正常启动流E,排查后发现是loadrunner的问题,用我机器上的lr录制正常Q错误代码提C是字段长度限制Q莫名其妙)?/p> <p>关于jvm crach我们也调整了heap讄Q?xms256m,-xmx1536m</p> <p>但是问题依然存在。后面我们重新安装了应用Q所有的讄采用~省配置Q没有打M补丁Q系l这个时候竟然可以正常跑了,只是响应很慢Q而且旉曲线一直往上抛Q测试一D|间系l无响应Q?/p> <p>查了一下配|,发现productdatasource的缺省设|竟然就?0Q?strong>q个时候基本判断是之前的websphere的设|修Ҏ(gu)有生?/strong></p> <p>重新修改jvm和连接池配置Q这时候系l正常,数据q接也达?3个,然后开始测试大q发?/p> <p> </p> <p>阶段二就是调整数据库配置</p> <p>1、第一个是db2 default buffer poolQ缺省配|buffer?mQ这个一定要注意修改</p> <p>2、第二个是db2的lock数量Q在~省基础上好像放大了100?/p> <p>3、sort heapQ排序区Q防止排序溢出)</p> <p>q些调整都要通过db2的状态来调整Q可以通过get snapshot指o(h)来获得数据库状态,buffer不够?x)出现大量的逻辑读,lock不够?x)抛lock溢出(?x)导致锁升Q,sort heap不够?x)提C排序溢出(q时候排序会(x)在硬盘做Q?/p> <p> </p> <p>回头看看q次支持Q?/p> <p>1、websphere配置修改不生效,我后面仔l想了想Q这个websphere很多公司用可能大安乱改了一通,另一问题是我们的使用?fn)惯Qwebsphere强烈不徏议用kill直接杀q程方式停服务器Qwebsphere不但是一个javaq程Q还有很多的附属q程Q直接kill也很Ҏ(gu)Dwebsphere不正?/p> <p>2、jvm crach问题Q这个我大家看看q篇文档<a title="http://www-1.ibm.com/support/docview.wss?rs=180&context=SSEQTP&q1=fragmentation&uid=swg21176363&loc=en_US&cs=utf-8&lang=en" >http://www-1.ibm.com/support/docview.wss?rs=180&context=SSEQTP&q1=fragmentation</a></p> <p><a title="http://www-1.ibm.com/support/docview.wss?rs=180&context=SSEQTP&q1=fragmentation&uid=swg21176363&loc=en_US&cs=utf-8&lang=en" >&uid=swg21176363&loc=en_US&cs=utf-8&lang=en</a></p> <p>如何d位jvm问题Q首先看nativerr.log日志Q如果出现OOMQ这里会(x)有记录,当发现OOM的时候,可以打开jvm的verbosegcQ分析verbosegc和jvm dump fileQ上面文档里提到一个很重要的东西就是pinned对象Q这也是ibm为啥不徏议设|ms=mx的原因?/p> <img src ="http://www.tkk7.com/tacy/aggbug/156908.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/tacy/" target="_blank">tacy lee</a> 2007-10-30 13:09 <a href="http://www.tkk7.com/tacy/archive/2007/10/30/156908.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>捕获DB2 sql的执行快?/title><link>http://www.tkk7.com/tacy/archive/2007/10/30/156907.html</link><dc:creator>tacy lee</dc:creator><author>tacy lee</author><pubDate>Tue, 30 Oct 2007 04:59:00 GMT</pubDate><guid>http://www.tkk7.com/tacy/archive/2007/10/30/156907.html</guid><wfw:comment>http://www.tkk7.com/tacy/comments/156907.html</wfw:comment><comments>http://www.tkk7.com/tacy/archive/2007/10/30/156907.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/tacy/comments/commentRss/156907.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/tacy/services/trackbacks/156907.html</trackback:ping><description><![CDATA[<p>先徏立一个监控器 <p>db2 "create event monitor SQLCOST for statements write to file '/home/db2inst1'" <p>再设|事务状态ؓ(f)打开 <p>db2 "set event monitor SQLCOST state=1" <p><font color="#ff0000">注:(x)1为打开Q?为关闭,攉数据之后Q记得关闭你的监控器Q否则。。?/font> <p>跑你的测试后Q在你的/home/db2inst1目录下会(x)生成一些evm文g <p>用下面指令获取诊断信息:(x) <p>db2evmon -db eos51 -evm SQLCOST>sqlcost1.txt <p>完成之后删除你的监控? <p>db2 "drop event monitor SQLCOST" <p>生成的采样例子,从下面的例子中,你可以清除的看到SQL执行的时_(d)CPU消耗情况,排序是否溢出QBufferPool的用情况,Ҏ(gu)q些信息QSQL的执行效率一目了Ӟ(x) <p>26) Statement Event ... <p>Appl Handle: 336 <p>Appl Id: C0A80421.O905.0ABDA5065446 <p>Appl Seq number: 0657 <p>Record is the result of a flush: FALSE <p>------------------------------------------- <p>Type : Dynamic <p>Operation: Execute <p>Section : 7 <p>Creator : NULLID <p>Package : SYSSN300 <p>Consistency Token : SYSLVL01 <p>Package Version ID : <p>Cursor : SQL_CURSN300C7 <p>Cursor was blocking: FALSE <p>Text : update WFProcessInst set relateData=? where processInstID= ? <p>------------------------------------------- <p><a><font color="#0080ff">Start Time: 04/25/2007 14:57:19.402248</font></a> <p><font color="#0080ff">Stop Time: 04/25/2007 14:57:19.409622</font> <p><font color="#0080ff">Exec Time: 0.007374 seconds</font> <p><font color="#0080ff">Number of Agents created: 1</font> <p><font color="#0080ff">User CPU: 0.000000 seconds</font> <p><font color="#0080ff">System CPU: 0.000000 seconds</font>    <a href="#_msocom_1">[licl1]</a> <p>Fetch Count: 0 <p><a><font color="#0080ff">Sorts: 0</font></a> <p><font color="#0080ff">Total sort time: 0</font> <p><font color="#0080ff">Sort overflows: 0</font>    <a href="#_msocom_2">[licl2]</a> <p>Rows read: 1 <p>Rows written: 1 <p>Internal rows deleted: 0 <p>Internal rows updated: 0 <p>Internal rows inserted: 0 <p><a><font color="#0080ff">Bufferpool data logical reads: 9</font></a> <p><font color="#0080ff">Bufferpool data physical reads: 0</font> <p><font color="#0080ff">Bufferpool temporary data logical reads: 0</font> <p><font color="#0080ff">Bufferpool temporary data physical reads: 0</font> <p><font color="#0080ff">Bufferpool index logical reads: 3</font> <p><font color="#0080ff">Bufferpool index physical reads: 0</font> <p><font color="#0080ff">Bufferpool temporary index logical reads: 0</font> <p><font color="#0080ff">Bufferpool temporary index physical reads: 0</font>    <a href="#_msocom_3">[licl3]</a> <p>SQLCA: <p>sqlcode: 0 <p>sqlstate: 00000 <hr align="left" width="33%" size="1"> <p><a></a> <p><a href="#_msoanchor_1">[licl1]</a>SQL执行旉和CPU消耗情? <p><a></a> <p><a href="#_msoanchor_2">[licl2]</a>SQL的排序情况,可以看到q个SQL没有排序Q当然也没有排序溢出 <p><a></a> <p><a href="#_msoanchor_3">[licl3]</a>Bufferpool的用情况,逻辑d物理ȝҎ(gu)</p> <div id="wtywuse" class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:54520e35-7c6a-476c-8521-71adb04f0c5b" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">del.icio.us Tags: <a rel="tag">database</a> , <a rel="tag">db2</a> , <a rel="tag">tuning</a> </div><img src ="http://www.tkk7.com/tacy/aggbug/156907.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/tacy/" target="_blank">tacy lee</a> 2007-10-30 12:59 <a href="http://www.tkk7.com/tacy/archive/2007/10/30/156907.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Loadrunner Analysis之Web Page Diagnosticshttp://www.tkk7.com/tacy/archive/2007/10/23/155375.htmltacy leetacy leeTue, 23 Oct 2007 11:04:00 GMThttp://www.tkk7.com/tacy/archive/2007/10/23/155375.htmlhttp://www.tkk7.com/tacy/comments/155375.htmlhttp://www.tkk7.com/tacy/archive/2007/10/23/155375.html#Feedback0http://www.tkk7.com/tacy/comments/commentRss/155375.htmlhttp://www.tkk7.com/tacy/services/trackbacks/155375.html作者:(x)tacy lee

单介l一下Loadrunner Analysis中的Web Page Diagnostics模块的用,很多人对于测试之后的l果数据分析怸着头脑Q其实loadrunner Analysisl你提供了很好的文档Q大家没事可以多ȝQ多d遍对于性能试你就入门?Q)

Web Page Diagnostics Q以下简UWPDQ,q是LR Analysis中非帔R要的一块,搞清楚这部分的内容会(x)让你走很多弯\Q很多环境问题都可以通过它来定位Q比如客L(fng)Q网l。通过它可以你可以比较好的来定位是环境的问题还是应用本w的问题Q当然更重要的是Web面本n的问题?/p>

WPD包括下面几个图表Q?/p>

Web Page Diagnostics     q是张dQ包括下面几张Over Time囄内容

Page Component Breakdown     面中每个元素的q_响应旉占整个页面响应时间的癑ֈ?/p>

Page Component Breakdown(Over Time)     在整个测试过E中QQ意一U内面中每个元素的响应旉Q例如在runtime中设|了browser cacheQ页面中的资源文件就只会(x)在第一ơ下载,后面的页面响应时间也׃包括q些元素的时_(d)q在Page Component Breakdown中是看不出来的,因ؓ(f)Page Component Breakdown是整个测试期间内的^均时间。当Ӟ是否启用了cacheQ通过over time囑ְ能看出来Q?/p>

Page Download Time Breakdown    面中每个元素的响应旉分割图,响应旉被分割ؓ(f)以下几个部分QDNS Resolution,Connection,First Buffer,SSL Handshaking,Receive,FTP Authentication,Client,Error

Page Download Time Breakdown(Over Time)      在整个测试过E中QQ意一U内面中每个元素的响应旉分割?/p>

Time to First Buffer Breakdown      First Buffer Time旉分割为Network Time和Server TimeQ客L(fng)httph发送到接收到服务器端的应答包(ACKQؓ(f)Network TimeQ从接收到ACK到完成First Buffer接受为Server Time

Time to First Buffer Breakdown(Over Time)      基本同上QQ意一U内?/p>

Downloaded Component Size(KB)      面中每个元素的大小QKBQ?/p>

介绍了这么多Q具体如何分析呢Q?/p>

首先打开Web Page Diagnostics图,来看看下面一个例子Download Time图:(x)

Web-Page-Diagnostics-DownloadTime

上图存在两个问题Q?/p>

1、receive旉很长

q个一般是|络问题Q当然如果你认|络不存在问题,那么你就要看看是不是客户端的问题Q客L(fng)也可能会(x)造成Receiveq长Q这个千万要注意Q?/p>

2、页面问?/p>

面上包括了非常多的囄Q而且囄g都没有优化,最大的竟然?63KQ记下来Q这可是|证?Q)

很多时候,你可以根据DNS,Connection,Receive来看出是否存在网l问题,Ҏ(gu)Client来判断是否存在客L(fng)问题?/p>

看看Q挺单的吧! ^_^

换个囄看,Page Component Breakdown(Over Time)

Web-Page-Diagnostics-PCB

很清楚吧Q页面元素都被cache了,说明场景启用了browser cacheQ页面的响应旉只包括红U和蓝线?/p>

Time to First Buffer Breakdown(Over Time)  Q图׃贴了Q这个图非常重要Q也最复杂Q这里的gl对Q当|络状况不好的时候,server time很可能包括网l时_(d)因ؓ(f)很多面元素比较?yu)(?k的样子)Q在First Buffer完成传输,所以一定要注意分析?/p>

唠叨到q里吧,Ƣ迎拍砖

del.icio.us Tags: , ,


tacy lee 2007-10-23 19:04 发表评论
]]>
weblogic 性能相关的几个配|?/title><link>http://www.tkk7.com/tacy/archive/2007/10/19/154249.html</link><dc:creator>tacy lee</dc:creator><author>tacy lee</author><pubDate>Fri, 19 Oct 2007 08:22:00 GMT</pubDate><guid>http://www.tkk7.com/tacy/archive/2007/10/19/154249.html</guid><wfw:comment>http://www.tkk7.com/tacy/comments/154249.html</wfw:comment><comments>http://www.tkk7.com/tacy/archive/2007/10/19/154249.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/tacy/comments/commentRss/154249.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/tacy/services/trackbacks/154249.html</trackback:ping><description><![CDATA[<p><em>作者:(x)tacy lee</em> <h4><a>weblogic.xml</a></h4> <p><em><container-descriptor></em> <p><strong>servlet-reload-check-secs</strong> <p>The <servlet-reload-check-secs> element defines whether a WebLogic Server will check to see if a servlet has been modified, and if it has been modified, reloads it. <ul> <li> <p>The value -1 means never check the servlets. This is the default value in a production environment.</p> <li> <p>The value 0 means always check the servlets.</p> <li> <p>The value 1 means check the servlets every second. This is the default value in a development environment.</p></li></ul> <p>A value specified in the console will always take precedence over a manually specified value. <p><strong>resource-reload-check-secs</strong> <p>The <resource-reload-check-secs> element is used to perform metadata caching for cached resources that are found in the resource path in the Web application scope. This parameter identifies how often WebLogic Server checks whether a resource has been modified and if so, it reloads it. <ul> <li> <p>The value -1 means metadata is cached but never checked against the disk for changes. In a production environment, this value is recommended for better performance.</p> <li> <p>The value 0 indicates not to do any metadata caching. Customers who keep changing their files must set this parameter to a value greater than or equal to 0.</p> <li> <p>The value 1 means reload every second. This is the default value in a development environment.</p></li></ul> <p>Values specified for this parameter using the Admin Console are given precedence. <p><strong>native-io-enabled</strong> <p>To use native I/O while serving static files with weblogic.servlet.FileServlet, which is implicitly registered as the default servlet, set native-io-enabled to true. (The default value is false.) native-io-enabled element applies only on Windows. <p><em><jsp-descriptor></em> <p><strong>page-check-seconds</strong> <p>Sets the interval, in seconds, at which WebLogic Server checks to see if JSP files have changed and need recompiling. Dependencies are also checked and recursively reloaded if changed. <ul> <li> <p>The value -1 means never check the pages. This is the default value in a production environment.</p> <li> <p>The value 0 means always check the pages.</p> <li> <p>The value 1 means check the pages every second. This is the default value in a development environment.</p></li></ul> <p>In a production environment where changes to a JSP are rare, consider changing the value of pageCheckSeconds to 60 or greater, according to your tuning requirements. <h4><a>JDBC</a></h4> <ul> <li> <p>讄Initial Capacity{于Maximum Capacity</p> <li> <p>讄Statement cacheQ注意,对于每个打开的statementQDBMS都会(x)l护一个cursorQ这个D|过大会(x)D java.sql.SQLException: ORA-01000: maximum open cursors exceededcM的错误。当Ӟ你要清楚Qstatement cache的大是指每个连接能cache的statement敎ͼ例如你设|connection pool size = 100 ,讄Statement Cache = 10Q那pȝ最大维持的cursor?00*10Q?/p></li></ul> <h4><a>Network connection</a></h4> <ul> <li> <p>Enable Native IO Q注意,不是java的NIOQ采用Java muxer方式处理q接Q对于大q发的系l媄响巨大,java需要ؓ(f)每个q接h起一个线E来处理Q?/p> <li> <p>修改Accept BacklogQ当应用服务器出现拒l连接的时?/p></li></ul> <h4><a>启动脚本</a></h4> <ul> <li> <p>使用productmode启动weblogic</p> <li> <p>讄-xms{于-xmx</p> <li> <p>量使用jrockit</p></li></ul> <h4><a>work manager</a></h4> <ul> <li> <p>?版本以后Qweblogic用work manager取代了thread queueQ默认情况下Qweblogic有一个default work managerQ采用fair share方式q_׃nU程</p> <li> <p>一般你不需要自己创建work managerQ除非你有如下需求:(x) <ul> <li> <p>你的应用有优先</p> <li> <p>你需要满SLA定义的响应时?/p> <li> <p>需要指定最线E约束来避免服务器死?/p></li></ul></li></ul> <p> </p> <div id="gomomsb" class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:49f96b29-87fc-4dde-9f13-6f8f16f2c890" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">del.icio.us Tags: <a rel="tag">weblogic</a> , <a rel="tag">tuning</a> , <a rel="tag">tips</a> </div><img src ="http://www.tkk7.com/tacy/aggbug/154249.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/tacy/" target="_blank">tacy lee</a> 2007-10-19 16:22 <a href="http://www.tkk7.com/tacy/archive/2007/10/19/154249.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>单的java io试http://www.tkk7.com/tacy/archive/2007/09/20/146771.htmltacy leetacy leeThu, 20 Sep 2007 06:27:00 GMThttp://www.tkk7.com/tacy/archive/2007/09/20/146771.htmlhttp://www.tkk7.com/tacy/comments/146771.htmlhttp://www.tkk7.com/tacy/archive/2007/09/20/146771.html#Feedback4http://www.tkk7.com/tacy/comments/commentRss/146771.htmlhttp://www.tkk7.com/tacy/services/trackbacks/146771.html
一个简单的java io试Q不同的实现Ҏ(gu)看一个zip包的解压速度  阅读全文

tacy lee 2007-09-20 14:27 发表评论
]]>
Ajax profiler toolshttp://www.tkk7.com/tacy/archive/2007/09/18/146290.htmltacy leetacy leeTue, 18 Sep 2007 15:08:00 GMThttp://www.tkk7.com/tacy/archive/2007/09/18/146290.htmlhttp://www.tkk7.com/tacy/comments/146290.htmlhttp://www.tkk7.com/tacy/archive/2007/09/18/146290.html#Feedback0http://www.tkk7.com/tacy/comments/commentRss/146290.htmlhttp://www.tkk7.com/tacy/services/trackbacks/146290.html一个简单的ajax性能分析工具Q比较实用?/p>

1、下?a >Ajax Viewq安装运行,它会(x)监听?888端口

2、打开IE或者FirefoxQ设|代理:(x)localhost:8888

3、打开你的ajax面Q执?/p>

4、另外开一个窗口,打开http://fakeurl.com/?&AJAXVIEWREQUEST=GET=main.html

5、选择左边的链接JS Performance StatisticsQ你可以看到具体的执行旉

 

延阅读Q?a title="http://www.fasterj.com/articles/javascript.shtml" >Javascript Performance

 

del.icio.us Tags: , , ,



tacy lee 2007-09-18 23:08 发表评论
]]>
Http协议的几个概念和web browser优化http://www.tkk7.com/tacy/archive/2007/09/07/143495.htmltacy leetacy leeFri, 07 Sep 2007 09:28:00 GMThttp://www.tkk7.com/tacy/archive/2007/09/07/143495.htmlhttp://www.tkk7.com/tacy/comments/143495.htmlhttp://www.tkk7.com/tacy/archive/2007/09/07/143495.html#Feedback0http://www.tkk7.com/tacy/comments/commentRss/143495.htmlhttp://www.tkk7.com/tacy/services/trackbacks/143495.html
写本文的目的是x清除http1.1?.0的具体区别,看过很多别h写的关于他们的概念,可能是没动手L试,L模模p糊  阅读全文

tacy lee 2007-09-07 17:28 发表评论
]]>
վ֩ģ壺 ޹Ʒһþ| ɱƬav| һҹaëƬƵ| ɫ͵͵| һ| ŮƵ| йŮר| ŷպۺϾþþ| ޾ƷƷ| jizzjizzձٸ| Ļѹۿ| 69ƷƵ| wwwƵ߹ۿ| պƷר | ѹva߹ۿ| ѿƬ| Ů۳Ƶ߿| ޾ƷAMMëƬ| պݺݾþ͵͵ɫۺ | ձ | ŮɫëƬѿ| þþƷվ| Ʒһ| 99þþùƷţţ| 97| Ů߿ѹۿ| Ʒwպ| av뾫Ʒվ| պƵ| ޹AVһ| ѺܻڵƵëƬ| aëƬѲȫ| ޻ɫѵӰ| | ҹҹAһ| þþùƷһ| ɫվWWWվ| gogo߹ۿ| 100ëƬȫ| Ʒ| լ߹ۿ޲|