淘宝商城(天猫)高级技术专家.3年研发+3年性能测试调优/系统测试+4年团队管理与测试架构、研发系统实践. 新舞台新气象, 深化测试基础架构及研发架构,希望能在某个技术领域成为真正的技术大牛。欢迎荐才http://bbs.51testing.com/viewthread.php?tid=120496&extra=&page=1 .邮件: jianzhao.liangjz@alibaba-inc.com,MSN:liangjianzhao@163.com.微博:http://t.sina.com.cn/1674816524

发布新日志

  • N年前电信性能测试实践的PPT

    2008-02-26 22:43:55

     

    初到alibaba,简单总结电信工作时的性能测试过程。望大家喜欢

    这个地方还无法上传PPT。

    那只有委屈各位移步: http://bbs.51testing.com/viewthread.php?tid=106834&extra=page%3D1&frombbs=1

  • [论坛] 俺也把初到alibaba的性能测试PPT发出来,免得发霉了:)

    2008-02-26 22:39:16

    rt。

    呵呵,应该无机密的内容在里面。

    PPT 是我在电信性能测试的一个小结。

    有问题请联系我

    性能测试实践.ppt
    (2008-02-26 22:39:16, Size: 298 kB, Downloads: 5246)

  • 上传图片的2种脚本

    2008-02-20 22:56:28

     

    系统一HTML:

     

    <form action="" method="post" enctype="multipart/form-data">
    <input type="hidden" name="action" value="/task/task_pool_process_image_achive_action" />
    <input name="event_submit_do_upload" type="hidden" value="

     

     录制下来的脚本:

      

    web_submit_data("process_image_achive.htm",

      "Action=http://bops.alibaba.net:8888/allTask/process_image_achive.htm",

      "Method=POST",

      "EncType=multipart/form-data",

      "RecContentType=text/html",

      "Referer=http://bops.alibaba.net:8888/allTask/process_image_achive.htm",

      "Snapshot=t11.inf",

      "Mode=HTML",

      ITEMDATA,

      "Name=action", "Value=/task/task_pool_process_image_achive_action", ENDITEM,

      "Name=event_submit_do_upload", "Value=anything", ENDITEM,

      "Name=actionEvent", "Value=imageAchieve", ENDITEM,

      "Name=_fmcr.pro._0.o", "Value=company", ENDITEM,

      "Name=_fmcr.pro._0.a", "Value=D:\\NCom_070723_212112_49.zip", "File=yes", ENDITEM,

      "Name=addnew", "Value=yes", ENDITEM,

      "Name=Submit1", "Value= "

      "\\xAE"

      " "

      "\\x9A"

      "(O) ", ENDITEM,

     

     

     

     

    系统2 的HTML

    <input type="file" id="logoFile" name="_fmn.sav._0.l" class="hiddenMask" ōnChange="comLogo.prePicture()" />

    application/octet-stream

     录制下来的脚本如下

      

    web_custom_request("save_company.htm",

      "URL=http://hz.my.alibaba.com/newborn/save_company.htm",

      "Method=POST",

      "Resource=0",

      "RecContentType=text/html",

      "Referer=http://hz.my.alibaba.com/newborn/save_company.htm",

      "Snapshot=t7.inf",

      "Mode=HTML",

      "EncType=multipart/form-data; boundary=---------------------------7d738225c60e78",

      "BodyBinary=-----------------------------7d738225c60e78\r\n"

      "Content-Disposition: form-data; name=\"action\"\r\n"

      ...

     "Content-Disposition: form-data; name=\"_fmn.sav._0.l\"; filename=\"D:"

      "\\x5C"

      "鍥介檯绔欐敼閫燶pic"

      "\\x5C"

      "NCom_070613_052134_266"

      "\\x5C"

      "company"

      "\\x5C"

      "70000151_aboutus1.JPG\"\r\n"

      "Content-Type: image/pjpeg\r\n"

      "\r\n"

      "\\xFF\\xD8\\xFF\\xE0\\x00\\x10"

      "JFIF"

     

    2种脚本都能正常工作,

     

     

     

  • mod_jk 配置不当导致响应时间缓慢以及吞吐率无法上升

    2008-02-20 22:50:04

    mod_jk.log 大量

    [Fri Nov 09 11:44:13 2007] [10151:10464] [info]  ajp_send_request::jk_ajp_common.c (1273): (ajp13) error connecting to the backend server

    [Fri Nov 09 11:44:13 2007] [10151:10464] [info]  ajp_service::jk_ajp_common.c (1941): (ajp13) sending request to tomcat failed,  recoverable operation attempt=1

    [Fri Nov 09 11:44:13 2007] [10156:10464] [info]  jk_open_socket::jk_connect.c (451): connect to 127.0.0.1:5081 failed (errno=110)

    [Fri Nov 09 11:44:13 2007] [10156:10464] [info]  ajp_connect_to_endpoint::jk_ajp_common.c (876): Failed opening socket to (127.0.0.1:5081) (errno=110)

    [Fri Nov 09 11:44:13 2007] [10156:10464] [info]  ajp_send_request::jk_ajp_common.c (1273): (ajp13) error connecting to the backend server (errno=110)

    [Fri Nov 09 11:44:13 2007] [10156:10464] [info]  ajp_service::jk_ajp_common.c (1941): (ajp13) sending request to tomcat failed,  recoverable operation attempt=1

     

     

    调整前的

     cat  workers.properties.bak
    worker.list=ajp13              
    worker.ajp13.port=5081         
    worker.ajp13.host=127.0.0.1
    worker.ajp13.type=ajp13

     

    Server.xml采用默认值。

    从症状看,不是程序的问题,是mod_jk配置有误。也不是版本失配。

     

     

    jbosstomcat配置加了这一段,maxThreads="350" maxProcessors="350" minSpareThreads="30" backlog="400" connectionTimeout="600000"

    apache  mod_jk  worker.property 增加pool的控制。 默认是一个连接。

    worker.localnode.lbfactor=1

    worker.localnode.connection_pool_size=50

    worker.localnode.connection_pool_minsize=25

    worker.localnode.connection_pool_timeout=600
    # Load-balancing behaviour
    worker.loadbalancer.type=lb
    worker.loadbalancer.balance_workers=localnode
    # Status worker for managing load balancer
    worker.status.type=status

     

  • loadrunner J2EE diagnositic 与loadrunner

    2008-02-20 22:42:43

     loadrunner 有专门的j2ee 诊断模块,可以降低性能分析瓶颈难度、透明化瓶颈环节。

     

    1.1.      访问diagnositic  server

     

    Loadrunner 8.1光盘里面有介质

    无多台diagnostic时,选择commander 模式安装介质。

    http://127.0.0.1:2006/

    或者远程 http://10.0.32.122:2006/  ,默认帐号是 admin

     

    1.2.      安装j2ee  probe

    选取diagnostic server10.0.32.122

    安装在C:\MercuryDiagnostics\JAVAProbe\

     

    startAgent.cmd 为启动代理,以便推送probe信息给server

    profiler.cmd   启动profiler

     

    http://127.0.0.1:35000 可以诊断probe是否安装好了

    配置文件位于 C:\MercuryDiagnostics\JAVAProbe\etc

     

    1.3.      loadrunner集成

    Loadrunner  license 管理器->configure  j2ee diagnostic

    但需要License.

    临时License 可以向hp mi 销售申请。

     

     

     

  • 性能测试高端发展方向

    2008-02-20 22:28:55

    业界认为性能测试ROLE划分为 性能测试工程师(偏重编写性能测试脚本、性能测试执行) 和性能测试分析师 (偏重性能分析、系统调优,也需要更加广、深)的知识。

     根据个人的理解,性能测试高端发展有如下一些方向: 性能调优,架构评估,性能监控,容量规划,应用性能管理。

      性能调优偏重系统级调优、代码级调优,需要非常熟悉系统架构、profile工具(如jprof, gprof ) 。有开发背景的最合适往这个走。

      架构评估偏重参与项目前期,根据以前的性能测试经验以及教训判断架构合理性。以后进一步发展成系统架构师。

     性能监控就是充分应用现有的工具(如 rpc.rstatd, openview, sitesope,cacti等)以及扩展工具满足详细指标,并图形化展现 容量规划则根据现有系统能力开展what if分析(如增加cpu,更换吞吐率,甚至机型),推算if之后系统性能表现,需要很强的数学功底以及建模能力。目前比较好的工具有teamquest。国内广东电信研究院评测中心和上海电信都在用。

      应用性能管理,可以参考Mercury 的BAC产品,如何抢在用户之前主动发现网站或者业务瓶颈。 可以利用QTP/loadrunner的脚本结合sitescope 主动监控。 目前浙江移动已经实施。

  • 性能测试碰到的主要问题

    2008-01-10 14:15:56

    性能测试碰到的主要问题:

    1) 性能测试需求不够精细。对于新系统,缺乏一个相对科学的估算方法; 对运营系统,现有系统日志分析的PV 与 更关注的业务笔数不完全相等,开发工程师应该在访问日志中加入新的统计方法并且和数据仓库平台整合。
    2) 生产环境数据库多为 IBM P系列小型机以及IO能力强劲的存储设备。 测试环境在db、存储以及数据量方面的能力相差很大,硬件模拟成为一个瓶颈。对于新系统,如何构造相对合理的模拟数据也成为需要解决的问题。
    3) Loadrunner 无jboss ,jvm ,os 内存/网络、队列长度等更精细的监控指标,为了减少手工合并监控结果,需要统一集成如上指标到Loadrunner。
    4) 大型系统定位性能瓶颈耗时长,为了缩短定位瓶颈、性能调整的周期,建议在应用中加入代码探针,达到代码级别的监控。
    5) 网站查询系统已经涵盖os大部分性能指标,但尚缺少部分指标。
    6) 寻求服务器瓶颈资源临界点,需要多次试探适合的压力。为了减少手工干预,需要编程实现产生自适应压力,以及执行服务器的准备、清理等工作。
    7) 为了提升容量规划的准确度,需要寻求合适的方法论、建模工具以及长期的积累、修正。目前比较成熟的商业工具有teamquest ,开源工具java  model tool 具备初步的模拟、分析能力,但没有集成硬件能力参数库。如何整合、扩展各开源工具,将成为一个难点。

     

  • 性能测试执行检查列表

    2007-08-12 21:22:15

     1  性能测试执行检查概览

    从各个层面考虑。

    • 1) 需求、方案内容以及形式检查
    • 2) 系统各个组件检查
    • 3) Loadrunner场景设置、脚本、监控指标、负载生成机的核对

    •2         核对《性能测试需求》

    •2.1       用例选取

    至少包含关键业务、最常用的用例,用例步骤为用户常用访问路径

    建议用例包含部分用户放弃或者失败的操作步骤

    确认负载建模数据来源

    •2.2       并发用户数需求

    并发用户数一般为在线活跃用户的15~25%间。

    用户归类是否合理、访问路径是否典型等work load

    •2.3       响应时间需求

    结合web 8 minute rule对比

    •2.4       服务器资源利用率需求

    应低于业界同行认可的资源阀值。

    •2.4.1    Unix

    Load:  < 5* cpu颗数

    Cpu%: <80%

    内存:swap-in/out =0

    网络%: collision rate =0

    •2.4.2    Windows

    网络:

       网络利用率阀值没有统一。  <30% or 80%?

    冲突率: <1%

    Packets Received Errors < 1%

    I/O:

    Disk Time %  <90%

    Avg. Disk Bytes/Read +  Avg. Disk Bytes/Write <20K

    Avg. Disk sec/Transfer <0.3 sec

    队列长度:Queue Length <2

      Avg. Disk sec/Transfer <18 milliseconds

    内存:

    Available Mbytes  >25%

        page in+out  <20 次

    pool Nonpaged Bytes =0

    处理器:

    利用率 <85%

    每个CPU队列长度 <2

    Context Switches/sec <5000次 或者<5% of total threads

    •2.4.3    应用特有指标

    •3         核对《性能测试方案》

    •3.1       测试策略

    • 1) 场景与用例应有针对性地攻击系统性能薄弱环节,条件允许的话建议定位出负荷过大的临界点
    • 2) 测试实现手段成本效益分析,确认技术与时间可行性。对于加解密、随机码等技术环节,应尽早技术试验确认测试可行性。
    • 3) 总吞吐率确保至少高于现网生产环境负载或者未来运营负载,充分考虑未来3年负荷增长
    • 4) 至少一个运行长于8小时的峰值场景甚至overload场景,以便挖掘内存泄露
    • 5) 分析测试环境与生产环境(硬件、参数、数据量)差异,确认测试方案的能力与缺陷。尽量往生产环境靠拢(缩放或者mirror)。如果测试环境与生产环境差异太大,则必须分析性能测试风险,同时在性能测试报告中注明该限制
    • 6) 针对不同的应用,测试重心应略有侧重。 如EAI 侧重数据交换,数据仓库侧重SQL查询语句等
    • 7) 建议有一个大量vuser的场景,确认无connections限制及模拟现实的离散访问。
    • 8) 需求以及方案经过项目经理与开发工程师确认

    •4         核对操作系统

    Alibaba目前大部分系统采用linux os,少数数据库部署在aix上。

    •4.1       硬件配置

    Linux:

    处理器:Cat  /proc/cpuinfo

    内存:Cat  /proc/meminfo

           网络:mii-tool -v

        硬盘: mount 确认 -> scsi/sda -> /proc目录下找到硬盘厂家 ->查到读写能力指标

    •4.2       版本号

    Uname -a

    Cat  /etc/ redhat-release

    •4.3       系统参数

    Sysctl -a

    Ulimit  -a

    建议测试时ulimit  -c unlimited启动core dump生成选项

    •4.4       进程

    确认portmap、rpc.rstatd进程存活

    应关闭无关的应用进程,以免干扰资源利用率数据

    •4.5       端口

    开放111端口

    •4.6          分区硬盘空间

    Df  -m 确认增长最快的分区有足够的余量。

    •5         核对数据库

    Alibaba应用大部分部署在oracle上。目前最流行的版本有oracle 9i与oracle 10g。一般情况下,由系统管理员负责监控数据与性能变化。

    •5.1       版本号

    •5.2       部署模式

    确认部署模式为 dedicated or  share

    •5.3       配置参数

    InitSID.ora 或者动态配置的文件参数,确认日志归档模式、SQL跟踪等。

    •5.4       基础数据与测试数据尺寸

    利用SQL 语句统计基础数据,同时确认测试数据准备情况

    对于测试后产生大量中间数据的场景,每次测试完毕应清除中间数据

    •6         核对应用服务器

    •6.1       Jboss

    •6.1.1    版本号

    •6.1.2    部署模式

    •6.1.3    配置参数

    •6.2       Weblogic

    流行版本weblogic8.1 ,weblogic9

    •6.2.1    版本号

    http://IP:7001/console查看

    •6.2.2    部署模式

    采用开发模式 or 部署模式

    是否采用集群

    •6.2.3    配置参数

    分析启动配置文件startWebLogic.sh以及关联的配置文件setEnv.sh、config.xml,重点关注线程数、backlog长度、是否采用native io等。

    •6.3       Resin

    •6.3.1    版本号

    •6.3.2    部署模式

    •6.3.3    配置参数

    •7         核对web 服务器

    •7.1       apache

    •7.1.1    版本以及编译模式、模块

    版本:httpd -v

    编译模式:httpd -V

    模块:httpd -l

    •7.1.2    配置参数

    主要配置文件为:Httpd.conf。

    主要确认进程模型、 maxclient、timeout、是否采用SSL协议等等。

    •7.1.3    DSO模块版本

    察看loadModule 配置项核对 DSO。

    •7.1.4    日志级别及文件

    一般, 错误日志: logs/error_log,访问日志:access_log

    注意清理日志,防止过度膨胀。

    •7.1.5    是否采用Cache模块

    前端是否采用 squid或者其他cache服务。

    •7.1.6    内容

    是否包含图片,javascrīpt,applet等non-html资源。

    •7.2       tomcat

    •8         核对应用系统

    •8.1.1    版本号

    •8.1.2    核心功能可用性

    •9         审查性能测试工具

    •9.1       审查LoadRunner组件

    •9.1.1    场景设置

    • 1) 场景模式面向目标/手工是否与方案相符合
    • 2) Pacing
    • 3) Think-time (是否有必要忽略)
    • 4) Download non-html resource (视应用是否应当下载)
    • 5) Simulate a new user on each iteration(登录录制于action.c时应selected)
    • 6) Continue on error
    • 7) 存放测试结果目录所在磁盘空间是否足够

    •9.1.2    Web协议脚本

      脚本流程与用户访问路径一致

    • 1) 关键业务事务须有检查点(如web_reg_find)
    • 2) 参数化数据及设置与业务需求预期 (随机、unique)
    • 3) 必要的地方增加关联 (web_reg_save_param)
    • 4) 必要的地方增加http header (web_add_auto_header)
    • 5) 必要的地方增加超时设置 ( web_set_timeout)
    • 6) 必要的地方增加随机数 (srand,rand)

    •9.1.3    Socket协议脚本

    贸易通客户端与服务器交互采用socket协议录制。

    • 1) 脚本行为与用户访问路径一致
    • 2) 确保可以正确收发网络包

    •9.1.4    监控指标

    各个服务器以及负载生成机都应该监控。至少包含cpu,mem,io,network资源指标。

    •9.1.4.1       unix

    建议监控指标至少包含

    • 1) Average load
    • 2) Collision rate
    • 3) Cpu utilization
    • 4) Disk traffic
    • 5) Incoming packets error rate
    • 6) outcoming packets error rate
    • 7) page in rate
    • 8) page out rate
    • 9) swap in rate
    • 10) swap out rate

    若如上指标还无法满足定位瓶颈需求,则弃用loadrunner monitor监控,而采用sitescope监控更多指标( ssh+ linux command) 。一般额外监控的有

    可用内存、Iowait%。

                  对于对比性能测试,确保服务器资源有一定余量以满足Utilization Law定律。

    •9.1.4.2       windows

    建议监控指标至少包含

    • 1) Process time%( process_total)
    • 2) Process queue length(system)

    • 3) Available mbytes( memory)
    • 4) Pool nopaged bytes (memory)
    • 5) Pages sec (memory)
    • 6) Pool nonpaged failures(system)

    • 7) Disk time% (physicaldisk _total)
    • 8) Avg. disk queue length (physical _total)

    • 9) Bytes total/sec (network interface)

    •9.1.5    负载生成机

    • 1) Loadrunner结果存放临时目录: temporary storage location 所在分区空间足够大
    • 2) 确保测试执行过程中各项资源充足,可发出足够的请求压力
    • 3) 建议关闭防火墙、反病毒等软件
    • 4) 确保开放端口 54345以及另一个动态端口
    • 5) 确保进程 (m)mdrv.exe,lr_bridge,magentproc.exe(作为进程)/magentservice(作为服务),r_host_balancer.exe等进程存活
    • 6) 若安装loadrunner时选择:Manual log in to the Load Generator
    • 7) 时间与服务器同步。若要求严格同步,则建议安装ntp服务。

    目前alibaba仅采用windows平台作为load generator。

    •9.2       审查自主研发测试工具

    •9.2.1    评估架构与能力、缺陷

    评估压力生成方式、限制条件、负载确认手段、结果收集与统计能力等

    •9.2.2    审查源码

    开发工程师应提供测试工具源码,性能测试工程师检查变量上限,如socket数,线程数等是否超过OS限制。

    •10    分析预测试性能测试结果合理性

    •10.1  Loadrunner测试结果

    分析测试结果是否符合排队网络、概率分布等核心原理

    负载生成机资源是否有余量

    output windows是否有connection refused、timeout等错误

    尽量确保测试结果是可重现的

    •10.2  OS系统操作错误

    察看系统日志是否存在错误,一般在 /var/log/messages

    •10.3  数据库错误

    Alert*.log是否有ora-X 等错误

    是否检测到死锁

    •10.4  应用服务器以及web服务器错误

    检查是否存在core dump

    检查日志是否存在 Exception ,Error,Warning等

  • web性能测试常用的调试、嗅探工具

    2007-08-12 21:09:58

    loadrunner 对16进制的数据展现不够友好,而且录制方式基于proxy的。

        在一些复杂的情况下,可能需要用sniffer方式录制脚本。

        本文汇总一些瑞士军刀。

    http  debugger  / proxy

    Monitor HTTP, Trace HTTP, Debug HTTP, Capture HTTP, Track HTTP and Analyze HTTP/HTTPS

    http://www.17testing.com/bbs/viewthread.php?tid=5675&extra=page%3D3

    一个梦寐以求的工具,终于找到了

    charles好像只能监控到本机ie进程有关的请求,而httplook可以看到本机所有的http请求。
    为什么这样说是我用测试工具测试时,httplook可以看到http的请求,而在charles上看不了。

    httplook和Charles的工作原理不同,一个是sniffer方式,一个是proxy方式,所以httplook可以监控本机所有的http请求,而Charles只能监控指定进程的请求。
    我找这个工具的主要目的是觉得LoadRunner在调试一些复杂的http脚本的时候,提供的功能不够强大。譬如,LR中的VuGen没有提供16进制观察通讯包的方式,而是\xFD\x5A等形式。如果一些字节合并在一起是一个汉字,则出现乱七八糟的汉字堆集的现象。Charles是一个非常直观,上手很快,且功能强大的观察http请求包的程序。 找了很久,看来这个工具最强大。
    因为我要用一个工具帮助我调试性能测试脚本,所以我倾向于用proxy方式的Charles,而不是Sniffer方式的httplook。如果用httplook,其它进程发送的http请求包和你要观察的进程发送的http请求包搅和在一起,反而干扰了你的工作。
    有一个和httplook相似的工具http monitor,也是SoftX公司开发的。


    SoftX公司两个软件, Http Debugger <---------> Charles       Proxy方式捕获通讯包
                                   Http Monitor <----------> Http Look      Sniffer方式捕获通讯包。

    ethereal

    tcp/ip格式。 对于http协议不够直观!直接混杂模式截取子网里面的数据包。

    可以保存截获的网络报为明文 。

    charles web debugging proxy

    Charles is an HTTP proxy / HTTP monitor / Reverse Proxy that enables a developer to view all of the HTTP traffic between their machine and the Internet.

    基于嗅探。可以回放脚本!!!可以解压缩deflate! 部分确认可以支持rpm 测试!

    http://www.xk72.com/charles/download.php 下载免费版。

    Micorosoft  fiddler

    http://www.fiddlertool.com/fiddler/

    很友好的展现

    YATT

    http://www.pocketsoap.com/

    http://www.dbanotes.net/web/yatt_webservice_debug.html

    基于wincap3.X 或者ms  raw sockets capture。 可以抓取loadrunner controller与主机之间的通信。

    SoftX HTTP Debugger

    http://www.filedudes.com/SoftX_HTTP_Debugger-download-43572.html

    HTTPLook - Test and debug communication over HTTP.

    http://www.ieinspector.com/httpanalyzer/

    IEInspector HTTP Analyzer is such a handy tool that allows you to monitor, trace, debug and analyze HTTP/HTTPS traffic in real-time. It is used by industry-leading companies including Microsoft, Cisco, AOL and Google.

    可以作为ie 的插件安装


  • 容量规划就这么高不可攀?

    2007-08-12 21:02:27

    最近在多个项目都碰到相当棘手的容量规划的问题,故投以更多的眼光关注。

    目前据我所知有 mercury  ,teamquest,bmc 等厂家有对应的产品,采用的多为复杂的数学模型,如排队网络,模拟,MVAP均值计算等实现。呵呵,是否我们可以用简陋的matlab数学建模替代呢?

    在网络上也看到一些open source 容量规划工具,如The Queueing ToolPak (QTP),Java Modelling Tools (JMT) ,但需要手工计算出规划工具所需的参数(如queue长度),以及缺少硬件参数库,这一点与teamquest相差甚远。

  • loadrunner监控apache2.X

    2007-03-29 13:45:53

    loadrunner监控apache

    安装apache

    linux上安装apache.  /bin/apachectl –v

    Server version: Apache/2.0.54.

    修改conf/httpd.conf

    ExtendedStatus On

    <Location /server-status>
    SetHandler server-status

    Order Deny,Allow
    #
    Deny from all
    Allow from all
    </Location>

    测试:

    http://10.0.4.81:2068/server-status?auto&refresh=Y成功。

    Loadrunner加入监控

    端口:2688,url: /server-status?auto

    错误:

    Monitor name :Apache. Parsing error, cannot find token: BusyServers. Measurement: BusyServers|10.0.4.81. Hints: 1) Such a measurement does not exist, or the html page may be different from the supported one. 2) Try to replace the Apache.cfg with appropriate Apache_<version>.cfg file in <Installation>\dat\monitors and rerun the application (entry point: CApacheMeasurement::NewData).   [MsgId: MMSG-47479]

    解决

    因为<Installation>\dat\monitors\apache.cfg针对apache 1.xstatus指标,与apache 2.0度量指标失配。

    故采用apache_2.0.x.cf 更名apache.cfg

  • Loadrunner监控weblogic

    2007-03-29 13:43:12

    下载

    http://commerce.bea.com/showproduct.jsp?family=WLS&major=9.2&minor=0

    选择windows平台。

    输入注册名与密码。

    安装

    点击server920_win32.exe,默认全部安装。

     

    配置domain

    Tools->configuration wizards->create a new weblogic domain,默认,输入weblogic管理员的用户名与密码  weblogic/weblogic

     

    参考http://dev2dev.bea.com.cn/techdoc/200306517.html。但与此有区别!

    启动domain

    User project s-> mydomain-> start 

    日志:bea\user_projects\domains\mydomain\servers\AdminServer\logs

    测试

    http://localhost:7001/console

    此为weblogic性能监控页面。

     

    选择JMX监控

     

    LoadRunner 7.x and 8.x does not support monitoring against WebLogic8.x out of the box.  In order to Monitor WebLogic8.x:

    1.      Go to <LoadRunner>\classes and rename the file jmxri.jar to something else.

    2.      Go to <LoadRunner>\dat\monitors and edit the weblogicmon.ini:

    a.             Set the JVM to point to JDK1.4

    b.            Comment out the JavaVersion entry if there is a complain about JDK versions

    c.             DO NOT comment out the reference to jmxri.jar in this file It must remain as shown below:

    JVM_CLASSES1=jmxri.jar

    3.      Copy the weblogic.jar from the server to the <LoadRunner>\classes directory.

    4.      In WebLogic 8.x server console, do not setup administration port on SSL.

     

    配置weblogic9.2 + jdk1.5 (失败)

    配置weblogicmon.ini

    Jvm= JVM=D:\Sun\AppServer\jdk\bin\java.exe

     

    Add measument 10.0.72.30:7001 之后弹出用户名/密码框,输入weblogic/weblogic,之后console显示:

    Starting http server...

    Loading webserver.properties[C:\Program Files\Mercury Interactive\Mercury LoadRu

    nner\classes\weblogicmon.jar(com\mercuryinteractive\monitors\xmlsource\webserver

    .properties)...

     

    Web Server started...

    Listening on port: 1112

    八月/22/2006 22:38:13: hostInit(4396:10.0.72.30)

    八月/22/2006 22:38:13: Weblogic classes found in CLASSPATH. Will not use CLASSPA

    TH servlet. However, monitor is limited to a single Weblogic version: 9.2.0.0

    八月/22/2006 22:38:16: getMetricList(10.0.72.30:7001)

    八月/22/2006 22:38:17: Found 0 counters in 1 objects in 1 seconds

     

     

     没有获取到度量数据!

     

     

    跟踪user_projects\domains\mydomain\servers\AdminServer\logs\access.log:

     

    10.0.68.48 - - [22/八月/2006:22:47:18 +0800] "HEAD /classes/jndi.properties HTTP/1.1" 404 0

    10.0.68.48 - - [22/八月/2006:22:47:18 +0800] "GET /classes/weblogic/factories/t3/t3EnvironmentFactory.class HTTP/1.1" 404 0

     

    telnet  10.0.72.30 7001

    GET /classes/weblogic/factories/t3/t3EnvironmentFactory.class HTTP/1.1

     

    当不启动 weblogic服务时,

     

    暂时没有办法监控weblogic9!

    采用jdk1.4+weblogic8.jar?

          Jdk1.5+ weblogic8.jar?

         Jdk1.4+ weblogic9.jar?

    Weblogic8.1+jdk1.4

     

    Jdk1.4:

    https://sdlc6d.sun.com/ECom/EComActionServlet;jsessionid=48CF8834C4B52334C76970B6401FA62F下载 j2sdk-1_4_2_12-windows-i586-p.exe

     

    weblogic:8.1

    http://commerce.bea.com/showallversions.jsp?family=WLS,选择windows 奔腾

    WebLogic Platform Net Installer (what's this?)

    OS Platform

    WebLogic Server/Express 8.1 with SP6

      全安装,默认。

       Configuration wizard -> create new domain -> basic weblogic domain -> mydomain

     

    5.      Go to <LoadRunner>\classes and rename the file jmxri.jar to something else.

    6.      Go to <LoadRunner>\dat\monitors and edit the weblogicmon.ini:

    a.             Set the JVM to point to JDK1.4

    b.            Comment out the JavaVersion entry if there is a complain about JDK versions

    c.             DO NOT comment out the reference to jmxri.jar in this file It must remain as shown below:

    JVM_CLASSES1=jmxri.jar

    7.      Copy the weblogic.jar from the server to the <LoadRunner>\classes directory.

     

     

     

     

     

     

  • loadrunner controller 传递参数的一个方法: lr_get_attrib_string

    2007-03-29 13:39:07

    lang  =    lr_get_attrib_string("lang"); 

     

       if (lang==NULL || (strcmp(lang,"chs")  && strcmp(lang,"en"))  )

          {

                 lr_error_message("lang argument error!!!!");

                 return  -1;

          }

     

       Controller run-time setting addition上增加一个name  =lang value=X 的参数传递入脚本。

  • loadrunner odbc并发用户时错误

    2007-03-16 21:25:18

       loadrunner ODBC协议的脚本在单个用户下运行不会出现错误, 在并发用户下出现 lrdb_exec:  "SQLExecute", return-code=-1, native-error-code=1461, SQLState=S1000, SQLError=[Oracle][ODBC][Ora]ORA-01461: can bind a LONG value only for insert into a LONG column

     论坛结论:

     

      Oracle ODBC Driver Thread Safety:I'm getting ora-01461 and ora-01460 errors when I turn multi-threading on for a pc app that makes oracle odbc connections. When using only a single thread, I never see these errors. I found a posting on the internet that led me to believe that the oracle odbc driver might be the problem.

      详见:http://forums.oracle.com/forums/thread.jsp?forum=61&thread=258096&message=&tstart=0&trange=15768373

     

     解决办法:在下载的Oracle ODBC v9.2.0.6.3 包内的说明 ODBCRelnotesUS.htm 找到相关修复的bug

      Fixed problem of ODBC failing with an ORA-1461 in a muli-threaded environment.  (Bug2403919, 2383556)

     安装Oracle ODBC v9.2.0.6.3 过程:

        http://metalink.oracle.com 下载patchno:3501955 oracle patchsets.要求有高于某个版本的安装工具,则下载p3501955_9205_winnt.rar,再安装或者下载

        oracle 10g的启动器。

        (Oracle ODBC Driver 9.2.0.6.3,ora92063.exe,http://www.oracle.com/technology/software/tech/windows/odbc/htdocs/utilsoft.html)

     

  • loadrunner 错误"Two Way Communication Error"解决办法

    2007-03-16 21:22:16

    Error: Two Way Communication Error: Function two_way_comm_post_message / two_way_comm_post_message_ex failed.  [MsgId: MERR-60990]

    MERR-60990LOADRUNNER错误的内部编号。KB网站无详细说明。

    注意观测controllerload generatorCPU/MEM/IO,防止过载。MEM过低会导致load generator出现虚拟内存过低的告警。

    建议load generator一般采用PC Server。一个odbc  Vuser大致消耗2500M/110=22M内存。

    mi公司建议打CPT 12533补丁(controller crash)

     

  • web_convert_param 函数在baidu.com搜索测试上的使用

    2007-03-16 21:07:35

    html方式录制baidu.com,比如查询”linux技巧”,则在runtime-viewer看到查询关键词并非”linux技巧

    改用url 模式录制,代码如后:

    web_url("s",            "URL=http://www.baidu.com/s?wd=linux%BC%BC%C7%C9&cl=3",

                 "Resource=0",

                 "RecContentType=text/html",

                 "Referer=http://www.baidu.com/",

                 "Snapshot=t4.inf",

                 "Mode=HTTP",

                 LAST);

     web_url("c.gif",

                 "URL=http://c.baidu.com/c.gif?t=0&q=linux%BC%BC%C7%C9",

                 "Resource=0",

                 "RecContentType=text/html",            "Referer=http://www.baidu.com/s?wd=linux%BC%BC%C7%C9&cl=3",

                 "Mode=HTTP",

                 LAST);

     

    回放出错,经ethreal截包,确有:http 204错误。

     

    Action.c(28): Error -26563: Non-empty response body is invalid with HTTP Status Code 204 (No Content) for "http://c.baidu.com/c.gif?t=0&q=linux%BC%BC%C7%C9"     [MsgId: MERR-26563]

    Action.c(28): t=1560ms: 1-byte response body for "http://c.baidu.com/c.gif?t=0&q=linux%BC%BC%C7%C9" (RelFrameId=1)

    Action.c(28):     \x00

    Action.c(28): Warning -26652: Response body length (1) does not match the Content-Length header specification (0) for "http://c.baidu.com/c.gif?t=0&q=linux%BC%BC%C7%C9"       [MsgId: MWAR-26652]

    Action.c(28): web_url("c.gif") highest severity level was "ERROR", 1 body bytes, 112 header bytes         [MsgId: MMSG-26388]

     

    为了参数化以及更正错误,正确的代码如后:

    web_convert_param("encoderesult", "SourceString={keyword}","SourceEncoding=HTML",

            "TargetEncoding=URL", LAST);

          lr_log_message("encode=%s",lr_eval_string("{encoderesult}"));

          web_url("s",

                 "URL=http://www.baidu.com/s?wd={encoderesult}&cl=3",

                 "Resource=0",

                 "RecContentType=text/html",

                 "Referer=http://www.baidu.com/",

                 "Snapshot=t4.inf",

                 "Mode=HTTP",

                 LAST);        

          lr_continue_on_error(LR_ON_ERROR_CONTINUE );

          web_url("c.gif",

                 "URL=http://c.baidu.com/c.gif?t=0&q=linux%BC%BC%C7%C9",

                 "Resource=0",

                 "RecContentType=text/html",            "Referer=http://www.baidu.com/s?wd=linux%BC%BC%C7%C9&cl=3",

                 "Mode=HTTP",

                 LAST);

  • web性能测试总结

    2007-03-16 21:03:25

    环境检查

    (1)    hosts绑定

    (2)    采用的dns,网关

    (3)    IE 设置:每次重新下载,安全站点

    (4)    网页有无采用ssl, 随机验证码,applet,加解密

    录制

    可选Uml,html模式。一般html脚本阅读性强,但控制力差。Uml控性强,可以对付复杂的关联。

    另外:

    scrīpt type:  contain explicit urls only

    Support charset: utf-8

    调试

    打开extended  log

    检索error ,http响应码

    简化客户端下载,uncheck  download non-html resources

    多尝试不同的选项, winnet replay

    借助ethreal

    借助 apache,weblogic,以及其他观测连接。确保vuser与真实用户一致性为

    结果分析

    参考

    http://blog.51testing.com/html/98/92598_itemid_4718.html

    从我自己的经验,关键区分是loadrunner/客户端/网络/服务器的错误。

  • unix 计数器disk traffic含义

    2007-03-16 20:56:39

    controller->tools->options

    可知如下为每3秒采样一次。

     

    等价

    iostat –d  3  n 输出的tps

    或者iostat –x  3 中的 r/s+w/s

    源码分析

    http://nchc.dl.sourceforge.net/sourceforge/rstatd/rpc.rstatd-4.0.1.tar.gz下载

    getdata.c ->函数getdata_setup,划分不同的版本如get_disk24

     

    unsigned long long   rio;

      unsigned long long wio;

      char line[1024];

      char device[128];

      int    diskno;

      /* open the /proc/partitions file */

      partitions = fopen("/proc/partitions", "r");

      if (NULL == partitions) {

             return;

      }

      /* skip two lines */

      fgets(buffer, sizeof(buffer), partitions);       /* 1. line */

      fgets(buffer, sizeof(buffer), partitions);       /* 2. line */

     

      /* accumulate all the io statistics */

      diskno = 0;

      while ((diskno < 4) && (line == fgets(line, sizeof(line), partitions))) {

             sscanf(line, " %*d %*d %*d %s "

                    "%lld %*d %*d %*d "

                    "%lld %*d %*d %*d "

                    "%*d %*d %*d\n",

                    device, &rio, &wio);

             if (isdisk(device)) {

                    s->dk_xfer[diskno++] = rio + wio;

             }

      }

     

    输出如:major minor  #blocks  name     rio rmerge rsect ruse wio wmerge wsect wuse running use aveq

     

       8     0  143114240 sda 20157282 76396662 781266460 1674746 51521287 557414054 576721790 18033503 0 16683724 23108039

       8     1     104391 sda1 420 989 2818 1640 412 387 1598 22310 0 20060 23950

       8     2    4192965 sda2 1693441 294 13549472 5620720 1368359 1659202 24230064 28566661 0 9972060 34221911

       8     3  138809632 sda3 18463289 76394995 767713138 39002769 50152516 555754465 552490128 32396225 0 7951734 31784871

     

    device, &rio, &wio分别取

    name     rio   wio。这些值都是read io/write operations since boot以来的值。To compute the io statistics for a disk, use the rio and wio operations,

    as they are closest to what we used to know as unix io operations. Use

    the wsect and rsect numbers to report block reads/writes.

     

    rio完成的读 I/O 设备总次数。指真正向 I/O 设备发起并完成的读操作数目,
    也就是那些放到 I/O 队列中的读请求。注意很多进程发起的读操作
    (read())
    很可能会和其他的操作进行 merge,不一定每个 read() 调用
    都引起一个 I/O 请求。

  • loadrunner无法监控域内的win xp机器的解决办法

    2007-03-16 20:46:13

     

    试图在loadrunner  monitor里面增加window xp机器的监控前,\\ip机器时,弹出警告:"\\IP \c$无法访问。你可能没有权限使用网络资源...."

     

    解决办法:

    更改本地安全策略:本地帐户的共享和安全模式为经典模式。控制面板->管理工具->本地安全策略->网络访问:本地帐户的共享和安全模式->经典模式。

    然后采用计算机管理->本地用户与组里面的用户登录。

     

     

    参考:

    http://www.ddvip.com/OS/win2000/index4/42.htm

    Windows系统的网络登录,一般我们首先想到的是3389登录,也就是通过终端连接服务器登录目标机 器。但是,你可能还不是十分清楚,Windows系统之间的网络登录其实大部分是通过139端口进行的。这是由SMB/CIFS协议所规定的,客户端通过 139建立连接,发送用户名和密码到服务器端,服务器端在139端口监听,接受到客户端的请求后,检查接收到的用户名和口令,如果错误,则拒绝连接,如果 正确,则给予客户端相应的权限,这就是Windows最基本网络登录过程

    首先自己的系统应该是WinNT以上的,Windows 98不可以,因为Win98网络管理这方面的功能很少,Windows 98没有IPCIPCWindows NTWindows 2K/XP/2003才有的。

    如果将登录模式设置为典型则登录过程中使用客户提供的用户进行登录,登录成功后具有这个用户的权限。如果设置为仅来宾,则登录过程中不 论是用什么用户登录,如果登录成功,则自动映射到来宾帐户,也就是只有Guest用户的权限,简单的说,Windows XP网络登录所获得的权限取决于系统的设置,如果为典型,那么你可以获得你所拥有用户的相应权限,如果你有超级用户,那么取得的权限就是超级用户权 限,而如果为仅来宾,那么无论你用什么用户权限,即使是超级用户,建立连接后得到的只能是Guest权限,很不幸的是,Windows XP系统默认设置是仅来宾

    对方是Windows XP系统,有了正确的超级用户的口令,用这个口令建立IPC连接成功,可是映射磁盘不成功,原因就出在Windows XP仅来宾的默认设置上,不管你用什么口令登录,都是Guest权限,而映射磁盘必须是Administrator权限。

392/2<12
Open Toolbar