友善交流技术...

发布新日志

  • PHP CURL API 接口测试

    2011-07-28 18:11:50

    class cmsApi {

    //初始化url参数
     function  urlinit($app_url,$url){
      $ch = curl_init();
      curl_setopt ($ch, CURLOPT_URL, $app_url.$url); //REST地址 GET  
      curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);
      curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 15); 
      return $ch ;
     }
     
    //JSON 数据格式 
     function xml_to_json($source) { 
     if(is_file($source)){             //传的是文件,还是xml的string的判断 
      $xml_array=simplexml_load_file($source); 
     }else{ 
      $xml_array=simplexml_load_string($source); 
     } 
     $json = json_encode($xml_array);  //php5,以及以上,如果是更早版本,请下载JSON.php 
     return $json; 
       }
     
    //【CMS-HLD_0.011】获取billingcode
     function getBillingcode_011(){
         // Get method
        //$app_url = "http://IP:8081/";
        $app_url = "http://IP:9081/";
        $url ='conferenceReservManager/getBillingcode/' ;
      //print_r($post_data);
         $ch = $this->urlinit($app_url,$url);
      curl_setopt($ch, CURLOPT_GET, 1);   
      $file_contents = curl_exec($ch);//获得返回值
      curl_close($ch);  
      return $file_contents; 
     }
     

    // getPasscode_012
     function  getPasscode_012($num){
      // Get method
        $app_url = "http://ip:9081/";
        $url = 'conferenceReservManager/getPasscode/'.$num;
        //echo $url ;   
      //初始化URL
         $ch = $this->urlinit($app_url,$url);
        
      curl_setopt($ch, CURLOPT_GET, 1);    
      $file_contents = curl_exec($ch);//获得返回值
      curl_close($ch);  
      return $file_contents; 
     }
    //获取acquirePin
     function  acquirePin_014($billingcode){
           // Get method
        $app_url = "http://ip:9081/";
        $url = 'conferenceReservManager/acquirePin/'.$billingcode;  

      //初始化URL
         $ch = $this->urlinit($app_url,$url);  
      curl_setopt($ch, CURLOPT_GET, 1);   
      $file_contents = curl_exec($ch);//获得返回值
      curl_close($ch);  
      return $file_contents; 
     }
     
    //reservConference
     function reservConference_007($billingcode,$pcode1,$pcode2){
      
       // Get method
        $app_url = 'http://ip:9081/cmsrest/rs/';
        $url = 'conferenceReservManager/reservConference/'; 
        
        $post_data ='{"xmlTemplateName":"/root/sme.xml","userId":"","applicationId":"SME-MEETING","value":{"2":"3,4","7":"23"},
        "conference":{"valid":0,"noticetime":0,"conferenceuservalues":{},"callout":false,
        "starttime":"2011-07-29T18:57:22Z","reservtime":"2011-07-26T18:57:22Z","conferencedesc":"","confscale":4,
        "billingcode":"'.$billingcode.'","password":"","product":{"productroles":{},"productid":3,"conferences":{},
        "conferenceservices":{}},"conferenceminutes":120,"pin":false,"roles":"4,5","conferencename":" tester 2011/7/30 01",
        "language":2,"realreserve":true},"pcode1":"'.$pcode1.'","pcode2":"'.$pcode2.'"}';
        
      //初始化URL
         $ch = $this->urlinit($app_url,$url);      
         $datatype ='application/json';
        $accepttype='text/plain';
         curl_setopt($ch, CURLOPT_POST,1); //设置POST方式
         curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); //发送的post值,目前已经放入url
         curl_setopt($ch, CURLOPT_HTTPHEADER, array (
              "Content-Type: ".$datatype."; charset=utf-8",
              "accept: ".$accepttype."; charset=utf-8"));  
      $file_contents = curl_exec($ch);//获得返回值
      curl_close($ch);  
      return $file_contents; 
     }
     
     
    //【CMS-HLD_0.001】userJoin
     function userJoin_001($LshyID,$pinCode){
           // Get method
         $app_url = "http://IP:9081/";
        $url = 'conferenceBusiness/userJoin/SME-MEETING/'.$LshyID;
        
         $post_data=$this->xml_to_json('<userDTO><clientType>2</clientType><domain>1</domain><ipaddr>192.168.12.155</ipaddr>
        <isowner>true</isowner><pinCode>'.$pinCode.'</pinCode><rolemap><entry><key>4</key><value/></entry><entry><key>7</key><value/>
        </entry><entry><key>8</key><value/></entry><entry><key>9</key><value/></entry><entry><key>10</key><value/></entry><entry>
        <key>11</key><value/></entry><entry><key>12</key><value/></entry><entry><key>13</key><value/></entry><entry><key>14</key><value/>
        </entry></rolemap><tempuserid>4</tempuserid><userName>liming</userName><userStatus>0</userStatus></userDTO>');
          
         //初始化URL
         $ch = $this->urlinit($app_url,$url);
      $datatype='application/json';
      $accepttype='application/json';
      //设置POST方式
       curl_setopt($ch, CURLOPT_POST, true);
       curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); //发送的post值,目前已经放入url
       curl_setopt($ch, CURLOPT_HTTPHEADER, array (
              "Content-Type: ".$datatype."; charset=utf-8",
              "accept: ".$accepttype."; charset=utf-8"));
           
      $file_contents = curl_exec($ch);//获得返回值
      curl_close($ch);  
      return $file_contents; 
     }
     }

     备注几点:

    1. GET 和 POST 提交是有区别的:

       其中get 请求的数据一般比较小的.POST提交的方法,可以提交比较大的数据量

    2. POST 方法提交

       注意数据格式和接受数据格式:如果错了,提交也会失败的.

     

  • memcacheget set 并发情况下进行压力测试

    2011-07-01 18:03:28

    1.memcache get ,set 在400并发情况下进行压力测试:
       结论是:单线程错误率比多线程错误率低,差2倍左右.具体的测试如下:  
    测试内容400个并发,执行10分钟。(多线程)
    测试结果:
    1.set error:320/55160=0.58%
    2.get error:640/55160=1.16%      已测试过程中一次set对应两次get,因此get的错误率会比其他两个高一倍。
    3.update error:320/55160=0.58%    更新前后比较不同
     
     
    测试内容400个并发,执行10分钟。(单线程)
    测试结果:
    1.set error:40/29240=0.14% 
    2.get error:120/29240=0.41%       已测试过程中一次set对应两次get,因此get的错误率会比其他两个高一倍。
    3.update error:40/29240=0.14%     更新前后比较不同

    总结:
    1.memcache set ,get 在高并发情况下存在失败的情况
    2.memcache 在多线程情况下,硬件资源都合理情况下,比单线程性能好,同时错误率也有相应的提升。
  • php 调用 sphinx

    2011-06-22 18:13:11

    <?php
    include 'SphinxClient.class.php';
    header('Content-Type: text/html;charset="UTF-8"');
    if ($_GET) {
        // 关键词
       
        $keyword = urldecode(trim(strip_tags($_GET['keyword'])));
        $keyword = "二手房" ;
        if ($keyword) {
            // 包含Sphinx的api文件
          //  require_once 'sphinxapi.php';
            // sphinx服务器地址
            $server = '10.115.12.78';

           // 端口
            $port   = 9312;
            // 索引名 为*时表示搜索所有索引
            $indexName = 'idx_sale_beijing';
            // 分页页码
            $page = intval($_GET['page']) > 1 ? intval($_GET['page']) : 1;
            // 每页显示的数量
            $pageSize = 30;
            $sphinx = new SphinxClient();
            // 建立连接
            $sphinx->SetServer($server, $port);
            // 连接超时时间(非常必要,比如sphinx服务器挂了等异常情况) 单位为s,秒
            $sphinx->SetConnectTimeout(3);
            // 最大查询时间 单位为ms,毫秒
            $sphinx->SetMaxQueryTime(2000);
            // 按分页取结果
            $sphinx->SetLimits(($page-1)*$pageSize, $pageSize); //第一个参数为offset,第二个参数为limit
            // 模式
            // $sphinx->SetMatchMode(SPH_MATCH_EXTENDED);
            // 取到的原始数据
            $orgDatas = $sphinx->Query($keyword, $indexName);
            // 调试用,如果有错误的话,可以打印$errors的值
            $errors = $sphinx->GetLastError();
            var_dump($errors);

           // echo '<pre>';
           // var_dump($orgDatas);
           
            $sp_error= $sphinx->Status() ;
            $sp_client= $sphinx->GetLastWarning();
            print_r($sp_client);
            /* // 下面是对结果的处理
            $datas = array('goods'=>array(),'total'=>0);
            if ($orgDatas['total'] > 0) {
                $datas['total'] = $orgDatas['total'];
                foreach ($orgDatas['matches'] AS $val) {
                    $val['attrs']['goods_id'] = $val['attrs']['goods_id_new'];
                    unset($val['attrs']['goods_id_new']);
                    $datas['goods'][] = $val['attrs'];
                }
            }
            var_dump($datas);
            */
        }
    } else {
        echo '<form. method="get"><input type="type" name="keyword"><input type="submit" value="商品搜索"></form>';
    }
    ?>

     

  • 利用Tokyo Tyrant构建兼容Memcached协议、支持故障转(转发)

    2011-06-21 14:11:14

       是日本人 平林幹雄 开拓的一款 DBM 数据库,该数据库读写非常快,哈希模式写入100万条数据只需0.643秒,读取100万条数据只需0.773秒,是 Berkeley DB 等 DBM 的几倍。


       是由同一作者开拓的 Tokyo Cabinet 数据库网络接口。它拥有Memcached兼容协议 ,也可以通过HTTP协议 举办数据交换。

      Tokyo Tyrant 加上 Tokyo Cabinet,构成 了一款支持 高并发的散播式恒久存储体系 ,对任何原有Memcached客户妒攀? 唇玻?可以将Tokyo Tyrant当作 是一个Memcached,但是,它的数据是可以恒久存储的。这一点,跟新浪的性子 一样。

      相比Memcachedb而言,Tokyo Tyrant具有以下上风 :

      1、妨碍 转移:Tokyo Tyrant支持 双机互为主辅模式,主辅库均可读写,而Memcachedb如今支持 类似MySQL主辅库同步的行动 实现读写星散,支持 “主理 事 器可读写、赞助 做事器只读”模式。

    这里应用 $memcache->addServer 而不是 $memcache->connect 去毗连 Tokyo Tyrant 做事器,是由于 当 Memcache 客户端应用 addServer 做事器池时,是按照 “crc32(key) % current_server_num”哈希算法将 key 哈希到差别 的做事器的,PHP、C 和 python 的客户端都是云云 的算法。Memcache 客户端的 addserver 具有妨碍 转移机制,当 addserver 了2台 Memcached 做事器,而此中 1台宕机了,那么 current_server_num 会由原来 的2变成 1。

      引用 memcached 官方网站和 PHP 手册中的两段话:

    引用 http://www.danga.com/memcached/
    If a host goes down, the API re-maps that dead host's requests onto the servers that are available.


    Failover may occur at any stage in any of the methods, as long as other servers are available the request the user won't notice. Any kind of socket or Memcached server level errors (except out-of-memory) may trigger the failover. Normal client errors such as adding an existing key will not trigger a failover.





      2、日记 文件体积小:Tokyo Tyrant用于主辅同步的日记 文件比拟 小,约莫 是数据库文件的1.3倍,而Memcachedb的同步日记 文件非常大,假如 不定期清理,很轻易 将磁盘写满。
    3、超大数据量下示意杰出 :

    但是,Tokyo Tyrant 也有错误:在32位操纵 体系 下,作为 Tokyo Tyrant 后端存储的 Tokyo Cabinet 数据库单个文件不能高出 2G,而64位操纵 体系 则不受这一限定 。以是 ,假如 应用 Tokyo Tyrant,推举在64位CPU、操纵 体系 上安装运行。
     一、安装
      1、起首 编译安装tokyocabinet数据库

    wget
    tar zxvf tokyocabinet-1.3.1.tar.gz
    cd tokyocabinet-1.3.1/
    ./configure
    make
    make install
    cd ../



      2、然后编译安装tokyotyrant

    wget
    tar zxvf tokyotyrant-1.0.0.tar.gz
    cd tokyotyrant-1.0.0/
    ./configure
    make
    make install
    cd ../





      二、设置
      1、创建 tokyotyrant数据文件寄放 目次

    mkdir -p /ttserver/



      2、启动tokyotyrant的主进程 (ttserver)
      (1)、单机模式

    ulimit -SHn 51200
    ttserver -host 127.0.0.1 -port 11211 -thnum 8 -dmn -pid /ttserver/ttserver.pid -log /ttserver/ttserver.log -le -ulog /ttserver/ -ulim 128m -sid 1 -rts /ttserver/ttserver.rts /ttserver/database.tch



      (2)、双机互为主辅模式
      做事器192.168.1.91:

    ulimit -SHn 51200
    ttserver -host 192.168.1.91 -port 11211 -thnum 8 -dmn -pid /ttserver/ttserver.pid -log /ttserver/ttserver.log -le -ulog /ttserver/ -ulim 128m -sid 91 -mhost 192.168.1.92 -mport 11211 -rts /ttserver/ttserver.rts /ttserver/database.tch



      做事器192.168.1.92:

    ulimit -SHn 51200
    ttserver -host 192.168.1.92 -port 11211 -thnum 8 -dmn -pid /ttserver/ttserver.pid -log /ttserver/ttserver.log -le -ulog /ttserver/ -ulim 128m -sid 92 -mhost 192.168.1.91 -mport 11211 -rts /ttserver/ttserver.rts /ttserver/database.tch



      (3)、参数阐发
      ttserver [-host name] [-port num] [-thnum num] [-tout num] [-dmn] [-pid path] [-log path] [-ld|-le] [-ulog path] [-ulim num] [-uas] [-sid num] [-mhost name] [-mport num] [-rts path] [dbname]

      -host name : 指定必要 绑定的做事器域名或IP所在。默认绑定这台做事器上的全部 IP所在。
      -port num : 指定必要 绑定的端标语 。默认端标语 为1978
      -thnum num : 指定线程数。默认为 8个线程。
      -tout num : 指定每个会话的超时工夫(单位 为秒)。默认永不超时。
      -dmn : 以守卫进程 行动 运行。
      -pid path : 输出进程 ID到指定文件(这里指定文件名)。
      -log path : 输出日记 信息到指定文件(这里指定文件名)。
      -ld : 在日记 文件中还记实 DEBUG调试信息。
      -le : 在日记 文件中仅记实 过错 信息。
      -ulog path : 指定同步日记 文件寄放 路径(这里指定目次 名)。
      -ulim num : 指定每个同步日记 文件的巨细 (譬喻128m)。
      -uas : 应用 异步IO记实 更新日记 (应用 此项会镌汰 磁盘IO损耗,但是数据会先放在内存中,不会立即 写入磁盘,假如 重启做事器或ttserver进程 被kill掉,将导致部分 数据损失。一样平常 情况下不提议应用 )。
      -sid num : 指定做事器ID号(当应用 主辅模式时,每台ttserver必要 差别 的ID号)
      -mhost name : 指定主辅同步模式下,主理 事 器的域名或IP所在。
      -mport num : 指定主辅同步模式下,主理 事 器的端标语 。
      -rts path : 指定用来寄放 同步工夫戳的文件名。

      假如 应用 的是哈希数据库,可以指定参数“#bnum=xxx”来前进性能。它可以指定bucket存储桶的数量 。譬喻指定“#bnum=1000000”,就可以将最新最热的100万条记实 缓存在内存中:

    ttserver -host 127.0.0.1 -port 11211 -thnum 8 -dmn -pid /ttserver/ttserver.pid -log /ttserver/ttserver.log -le -ulog /ttserver/ -ulim 128m -sid 1 -rts /ttserver/ttserver.rts /ttserver/database.tch#bnum=1000000



      假如 大宗的客户端拜访ttserver,请确保文件刻画 符够用。很多 做事器的默认文件刻画 符为1024,可以在启动ttserver前应用 ulimit下令 前进这项值。譬喻:

    ulimit -SHn 51200



      3、收场tokyotyrant(ttserver)

    ps -ef | grep ttserver


      找到ttserver的进程 号并kill,譬喻:

    kill -TERM 2159





      三、调用
      1、任何Memcached客户端均可直接调用tokyotyrant。

      2、还可以通过HTTP行动 调用,下面以Linux的curl下令 为例,先容 怎样 操纵 tokyotyrant:
      (1)、写数据,将数据“value”写入到“key”中:

    curl -X PUT -d "value"



      (2)、读数据,读取“key”中数据:

    curl



      (3)、删数据,删除“key”:

    curl -X DELETE
  • apache ab性能测试

    2011-06-19 12:42:56

     参数很多,一般我们用 -c 和 -n 参数就可以了。例如:

      ./ab -c 1000 -n 1000 http://127.0.0.1/index.php

      这个表示同时处理1000个请求并运行1000次index.php文件。

      #/usr/local/xiaobai/apache2054/bin/ab -c 1000 -n 1000 http://127.0.0.1/index.html.zh-cn.gb2312

      This is ApacheBench, Version 2.0.41-dev <$Revision: 1.121.2.12 $> apache-2.0

      Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/

      Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/

      Benchmarking 127.0.0.1 (be patient)

      Completed 100 requests

      Completed 200 requests

      Completed 300 requests

      Completed 400 requests

      Completed 500 requests

      Completed 600 requests

      Completed 700 requests

      Completed 800 requests

      Completed 900 requests

      Finished 1000 requests

      Server Software: Apache/2.0.54

      //平台apache 版本2.0.54

      Server Hostname: 127.0.0.1

      //服务器主机名

      Server Port: 80

      //服务器端口

      Document Path: /index.html.zh-cn.gb2312

      //测试的页面文档

      Document Length: 1018 bytes

      //文档大小

      Concurrency Level: 1000

      //并发数

      Time taken for tests: 8.188731 seconds

      //整个测试持续的时间

      Complete requests: 1000

      //完成的请求数量

      Failed requests: 0

      //失败的请求数量

      Write errors: 0

      Total transferred: 1361581 bytes

      //整个场景中的网络传输量

      HTML transferred: 1055666 bytes

      //整个场景中的HTML内容传输量

      Requests per second: 122.12 [#/sec] (mean)

      //大家最关心的指标之一,相当于 LR 中的 每秒事务数 ,后面括号中的 mean 表示这是一个平均值

      Time per request: 8188.731 [ms] (mean)

      //大家最关心的指标之二,相当于 LR 中的 平均事务响应时间 ,后面括号中的 mean 表示这是一个平均值

      Time per request: 8.189 [ms] (mean, across all concurrent requests)

      //每个请求实际运行时间的平均值

      Transfer rate: 162.30 [Kbytes/sec] received

      //平均每秒网络上的流量,可以帮助排除是否存在网络流量过大导致响应时间延长的问题

      Connection Times (ms)

      min mean[+/-sd] median max

      Connect: 4 646 1078.7 89 3291

      Processing: 165 992 493.1 938 4712

      Waiting: 118 934 480.6 882 4554

      Total: 813 1638 1338.9 1093 7785

      //网络上消耗的时间的分解,各项数据的具体算法还不是很清楚

      Percentage of the requests served within a certain time (ms)

      50% 1093

      66% 1247

      75% 1373

      80% 1493

      90% 4061

      95% 4398

      98% 5608

      99% 7368

      100% 7785 (longest request)

      //整个场景中所有请求的响应情况。在场景中每个请求都有一个响应时间,其中50%的用户响应时间小于1093毫秒,60%的用户响应时间小于1247 毫秒,最大的响应时间小于7785 毫秒。

      由于对于并发请求,cpu实际上并不是同时处理的,而是按照每个请求获得的时间片逐个轮转处理的,所以基本上第一个Time per request时间约等于第二个Time per request时间乘以并发请求数。

  • 性能测试优化总结

    2011-06-14 11:34:59

    测试时间 发现问题 解决办法 效果
    2011-04-26-优化-apache web cpu资源不足 1cpu->4cpu 解决问题
           
    2011-05-10-性能优化 性能优化    
           
    2011-05-12-性能优化 sphinx 压力过大 1.调整后端数据流向
    2.走memcache缓存
    良好
           
    2011-05-24-memcache长链接不释放 php.ini 参数做如下调整
               session.save_path = "tcp://10.1.71.29:11211?persistent=0&weight=2&timeout=1&retry_interval=15"   以前是=1 现在调整成 = 0 ,
            现在线上链接数量在10个左右,基本上解决持久链接不释放的问题.
    0 代表不持久链接 ; 1 代表持久链接   最后修改了本参数,链接问题解决了.
    persistent=0 持久链接失效/ 良好

    优化系统 具体优化点 优化意见
    客户端 1.本地缓存技术 1.要求实现
    .CSS,JS压缩处理 1.要求实现
    3.代码压缩技术 1.要求实现
    函数优化 1如loadsucha方法:在卖房 ; 租房 ;小区列表; 小区检索中出现。本方法在这几个功能模块中不应该存在,它会自动加载本页面,造成大量的无用的请求和网络带宽 1.减少无用函数重复的调用,删除这个方法。
    后端数据调用  1.小区列表  1.要求走memcache
    2.小区房价  1.要求走TC
    3.小区相册  1.要求走TC
    4.小区详情  1.要求走TC
    5.房源详情,比较慢 1.要求走TC,不走DB
    SQL语句优化 1.SELECT *  FROM `t_rent` WHERE `house_id` =  '256'   AND
    `status` =  '1'  order by refresh_time desc  LIMIT 0,6;  最新出租房源
    1.要求只取需要的字段,不要用*
    2.速度比较慢,建议走缓存
    2.u SELECT count(*) as count FROM `t_rent` WHERE `company_id` =  '101'   AND `agent_id` =  '1'   AND `status` =  '1'; 公司门店有效出租房源量 1.要求只取需要的字段,不要用*
    2.速度比较慢,建议走缓存
    3.SELECT count(*) as count FROM `t_sale` WHERE `status` =  '1';
    //出售房源
    1.修改成sphinx获取数据
    4.u SELECT count(*) as count FROM `t_rent` WHERE `status` =  '1';  //出租房源 1.修改成sphinx获取数据
    首页优化 1.外部服务器慢
    http://cms.xxx.com/upload/js/jquery.js?_=1304393380272
    1.要求修改,客户端要求添加缓存
    2.google 统计 1.放到body 最后面
    3.首页-房价走势 1.默认值:城市,直接走缓存取数据,具体的flash还没有处理方法
    4.您可能感兴趣的房源 1.数据要求缓存 1小时缓存
    系统安全 1.VIP,ADMIN 增加验证码  
    不确定优化方法 1.sphinx CPU使用率达 100%  
    2.CMS 系统比较慢(可能是网络的原因)  

     

     

    优化工作:

      对自己在公司做的工作做如下的总结:

    1.优化方面1:业务调整,过度或是频繁调用程序都会造成软件的使用不合理

    2.memcache 长短链接测试,其中false代码是短链接的.马上释放.

    3.js ,jpg ,css 在网站的优化也相当的重要的

  • memcache 性能优化测试

    2011-06-14 11:29:06

     memcache 性能测试:对于memcache 版本V1.4.5 针对不同的参数进行了如下的测试测试结果如下:

     

    场景名称 参数 响应时间 PV CPU CONN TCP
    100user-m-2024 -m-2024 0.071 1368 70-80% 20-31 5800-6000
    200user-m-2024 -m-2024 0.138 1387 80-90% 40-60 5800-6006
    300user-m-2024 -m-2024 0.207 1391 80-90% 50-70 5800-6000
    400user-m-2024 -m-2024 0.271 1380 85-92% 60-80 4400-5100
                 
    300user-m-2024-t-1 -m-2024-t-1 0.203 1410 80-92% 40-60 4900-5200
    300user-m-2024-t-1-c-2048 -m-2024-t-1-c-2048 0.202 1412 80-92% 40-60 4900-5400
    300user-m-2024-t-64-c-2048 -m-2024-t-64-c-2048 0.215 1304 80-92% 240-260 5000-6000
    300user-m-2024-t-2-c-2048 -m-2024-t-2-c-2048 0.204 1393 80-92% 40-70 5000-6000
    300user-m-2024-t-1-c-5000 -m-2024-t-1-c-5000 0.198 1420 80-92% 40-60 5000-5800
    300user-m-2024-t-1-c-5000-f-1.1 -m-2024-t-1-c-5000-f-1.1 0.202 1415 80-92% 40-60 5000-5800

     

     从图中可以发现,在本环境中,单个线程比多个线程的效果更了,根据官方的资料显示,memcache对多线程的支持不是太好的.

       如果并发量不是很大的话,建议采用单线程进行.

  • Browser emulation

    2011-05-06 13:05:23

    Browser emulation 实验
    实验一:
      1.默认设置 
      结果
      1.数据量为:
       123784 body bytes, 4956 header bytes  
    实验二:
      1.设置为 simulate a new user on each iteration 去掉对钩
             clear cache on eache iteration
        结果
       1.数据量为:
        107159 body bytes, 4953 header bytes 
    实验三:
       1.设置为:
         download non-html resources 去掉对钩 其它默认值
       结果
       1.数据量为: 2254 body bytes, 428 header bytes
    结论:
       1.默认设置是请求数据是最大的,也就是每一个用户都是一次新的请求,没有做过处理,是用户真实的操作行为
       2. 实验二:将部分的页面缓存起来,但是还要进行下载的。
       3. 实验三:不下载图片资源,其它的资源都在缓存中已经存在的。所以下载的数据量比较小的。只下载html的资源 
  • action and step 区别

    2011-05-06 09:43:06

    action and step 区别
    实验一:
      1.一个脚本中两个 web_url aaa ,bbb
      2.放置在一个action 中
      3.选择 define each action as a transaction
    结束分析中:
     sum tps: 16.2
     hits: 240 左右
    实现二:  
      1.一个脚本中两个 web_url aaa,bbb
      2.放置在一个 action 中 
      3.选择 define each step as a transaction
    结果分析中:
     sum tps : 32 左右
     hits :240 左右
    实现三:
     1.一个脚本中两个 web_url aaa,bbb
      2.放置在一个 action 中 
      3.选择 define each action as a transaction
      4.给 aaa 增加事务为: aaa-trans
    结果分析中:
     sum tps : 32 左右
     hits :240 左右
    实现四:
     1.一个脚本中两个 web_url aaa,bbb
      2.放置在一个 action 中 
      3.选择 define each step as a transaction
      4.给 aaa 增加事务为: aaa-trans
    结果分析中:
     sum tps : 48 左右
     hits :240 左右
     总结:loadruner会自动将用户自己定义的事务和脚本的事务相加后,得到一个总共的sum tps 其实这样就会重复计算里面的事务数量。
     但是loadrunner有一个过滤的功能,可以将这一部分自己定义的事务去掉,提到真实的TPS,也是我们平时说的 PV/S 。
     其实真正反映服务器的性能转点是 HITS,通过它我们可以直接看到服务性能的容量。我一般都会看这个指标,但是有一个问题,就是它会统计:js ,css,jpg等等这也算是一个请求,这样的请求其实对服务器的压力比较小的,如果算一个PV 其实也是不准确的。
      所以我们现在测试,就按每一个web_url web_submit_form 按步来进行计算这样更真实的反映我们服务器的PV值。
      这个也是自己以前不太清楚的地方,今天做了几个实验,验证了自己的想法。高兴。。。


  • gets,pin 转载

    2011-04-08 15:36:32

    上周末看到asktom上的一个帖子,其中有人提到session_cached_cursors和cursor_space_for_time对library cache gets&pin的影响,帖子的url为
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:465420331879

    其中tom还为我们展示了session_cached_cursors和cursor_space_for_time对library cache gets&pin在9i和10g中的影响是不同的。

    先让我们来了解一下session_cached_cursors,cursor_space_for_time,library cache gets,pin

    session_cached_cursors:
    设置pga端的cache list的长度,当session_cached_cursors设置为0时,pga的cache list长度为0,这时候当sga中的cursor关闭的时候它相关的library cache handle的lock位被清0,从v$open_cursor里看不到这个被关闭的cursor,它服从于shared pool的lru机制,当shared pool需要新的buffer空间时,它将会被flush出shared pool。当session_cached_cursors设置为非0值时,pga的cache list长度为session_cached_cursors值的大小,同时pga cache list将会保留一份拷贝,这时候即使sga中的cursor关闭的时候它相关的library cache handle始终被加了null mode lock,当shared pool空间紧张时library cache handle始终将会被保留在shared pool中.而新的应用访问这个cursor的时候会直接去自己的pga cache list里面搜索。

    cursor_space_for_time:
    当设置了session_cached_cursors为非0值后,如果cursor_space_for_time值被设为false,那么当shared pool空间紧张时,虽然library cache handle不会被flush出去,但是它指向的library cached object(lco,其中包含了handle和children handle的地址,权限,类型,状态,指向kgl block的指针,其中kgl block包含了真正的代码段和执行计划等内容)将会被flush出去而不管它相关的cursor有没关闭,如果需要lco的时候将要reloads。
    如果cursor_space_for_time值被设为true,那么当cursor在打开状态下,handle指向的lco将不会被flush出shared pool,这样就可以降低reloads出现的频率。不过对于sql共享做的不好的数据库,设置
    cursor_space_for_time将会带来一些问题,share pool可能会出现04031的错误。

    gets:
    当试图parse一句sql时,oracle要先获得一个handle,在handle上加载一个lock,gets表示handle request times。

    pin:
    当获得handle后,定位到lco,然后pin住lco使它在被执行的时候不被flush出去。

    既然理解了以上一些概念,那么我们可以通过一些代码演示session_cached_cursors,cursor_space_for_time对pin,gets的影响

    在9i和10g中两个参数对pin,gets的影响也不一样

    9i:

    vi 1.sql

    set wrap off
    set linesize 100
    set pagesize 0
    set verify off
    select namespace, gets, gethits, pins, pinhits from v$librarycache where namespace = ‘SQL AREA’ ;
    select namespace, gets, gethits, pins, pinhits from v$librarycache where namespace = ‘SQL AREA’ ;
    select namespace, gets, gethits, pins, pinhits from v$librarycache where namespace = ‘SQL AREA’ ;
    select namespace, gets, gethits, pins, pinhits from v$librarycache where namespace = ‘SQL AREA’ ;
    select namespace, gets, gethits, pins, pinhits from v$librarycache where namespace = ‘SQL AREA’ ;
    select namespace, gets, gethits, pins, pinhits from v$librarycache where namespace = ‘SQL AREA’ ;
    select namespace, gets, gethits, pins, pinhits from v$librarycache where namespace = ‘SQL AREA’ ;
    select namespace, gets, gethits, pins, pinhits from v$librarycache where namespace = ‘SQL AREA’ ;
    select namespace, gets, gethits, pins, pinhits from v$librarycache where namespace = ‘SQL AREA’ ;

    执行10次sql

    SQL 9I>show parameter cursor
    NAME TYPE VALUE
    ———————————— ———– ——————————
    cursor_space_for_time boolean FALSE
    session_cached_cursors integer 0

    SQL 9I>@$HOME/1.sql
    NAMESPACE GETS GETHITS PINS PINHITS
    ————— ———- ———- ———- ———-
    SQL AREA 2942908 2939105 75218597 75211231
    SQL AREA 2942909 2939106 75218600 75211234
    SQL AREA 2942910 2939107 75218603 75211237
    SQL AREA 2942911 2939108 75218606 75211240
    SQL AREA 2942912 2939109 75218609 75211243
    SQL AREA 2942913 2939110 75218612 75211246
    SQL AREA 2942914 2939111 75218615 75211249
    SQL AREA 2942915 2939112 75218618 75211252
    SQL AREA 2942916 2939113 75218621 75211255
    SQL AREA 2942917 2939114 75218624 75211258

    可以看到gets每次增加1,pin每次增加3

    修改session_cached_cursors=100;

    SQL 9I>alter session set session_cached_cursors=100;
    SQL 9I>@$HOME/1.sql
    SQL AREA 2942935 2939123 75218728 75211344
    SQL AREA 2942935 2939123 75218730 75211346
    SQL AREA 2942935 2939123 75218732 75211348
    SQL AREA 2942935 2939123 75218734 75211350
    SQL AREA 2942935 2939123 75218736 75211352
    SQL AREA 2942935 2939123 75218738 75211354
    SQL AREA 2942935 2939123 75218740 75211356
    SQL AREA 2942935 2939123 75218742 75211358
    SQL AREA 2942935 2939123 75218744 75211360
    SQL AREA 2942935 2939123 75218746 75211362

    gets不再增加,pin增加2

    SQL 9I>show parameter cursor
    NAME TYPE VALUE
    ———————————— ———– ——————————
    cursor_space_for_time boolean TRUE
    session_cached_cursors integer 100

    SQL 9I>@$HOME/1.sql
    NAMESPACE GETS GETHITS PINS PINHITS
    ————— ———- ———- ———- ———-
    SQL AREA 932 508 3561 3159
    SQL AREA 933 509 3563 3161
    SQL AREA 934 510 3565 3163
    SQL AREA 934 510 3566 3164
    SQL AREA 934 510 3567 3165
    SQL AREA 934 510 3568 3166
    SQL AREA 934 510 3569 3167
    SQL AREA 934 510 3570 3168
    SQL AREA 934 510 3571 3169
    SQL AREA 934 510 3572 3170

    cursor_space_for_time改为ture后,pin变成每次增加1

    10g:
    SQL 10G>show parameter cursor
    cursor_space_for_time boolean FALSE
    session_cached_cursors integer 0

    SQL 10G>@$HOME/1.sql
    SQL AREA 3328 98 23112 21363
    SQL AREA 3328 98 23113 21364
    SQL AREA 3328 98 23114 21365
    SQL AREA 3328 98 23115 21366
    SQL AREA 3328 98 23116 21367
    SQL AREA 3328 98 23117 21368
    SQL AREA 3328 98 23118 21369
    SQL AREA 3328 98 23119 21370
    SQL AREA 3328 98 23120 21371
    SQL AREA 3328 98 23121 21372

    gets不变化,pin每次增加1

    SQL 10G>alter session set session_cached_cursors=100;
    SQL 10G>@$HOME/1.sql
    SQL AREA 3513 98 28456 26335
    SQL AREA 3513 98 28457 26336
    SQL AREA 3513 98 28458 26337
    SQL AREA 3513 98 28459 26338
    SQL AREA 3513 98 28460 26339
    SQL AREA 3513 98 28461 26340
    SQL AREA 3513 98 28462 26341
    SQL AREA 3513 98 28463 26342
    SQL AREA 3513 98 28464 26343
    SQL AREA 3513 98 28465 26344
    设置了session set session_cached_cursors后没有变化

    SQL 10G>show parameter cursor
    NAME TYPE VALUE
    ———————————— ———– ——————————
    cursor_space_for_time boolean TRUE
    session_cached_cursors integer 100
    SQL 10G>@$HOME/1.sql
    NAMESPACE GETS GETHITS PINS PINHITS
    ————— ———- ———- ———- ———-
    SQL AREA 1038 24 4404 3488
    SQL AREA 1038 24 4405 3489
    SQL AREA 1038 24 4406 3490
    SQL AREA 1038 24 4407 3491
    SQL AREA 1038 24 4408 3492
    SQL AREA 1038 24 4409 3493
    SQL AREA 1038 24 4410 3494
    SQL AREA 1038 24 4411 3495
    SQL AREA 1038 24 4412 3496
    SQL AREA 1038 24 4413 3497

    设置cursor_space_for_time为true后也没有变化

    但是当设置cursor_space_for_time为true后pl/sql block将会使pin也停止增长

    看tom的例子

    ops$tkyte@ORA10G> create or replace procedure p
    2 authid current_user
    3 as
    4 l_ns varchar2(4000);
    5 l_gets number;
    6 l_gethits number;
    7 l_pins number;
    8 l_pinhits number;
    9 l_sgets number;
    10 l_sgethits number;
    11 l_spins number;
    12 l_spinhits number;
    13 begin
    14 for i in 1 .. 1000
    15 loop
    16 execute immediate
    17 ’select namespace, gets, gethits, pins, pinhits
    18 from v$librarycache
    19 where namespace = ”SQL AREA” ‘
    20 into l_ns, l_gets, l_gethits, l_pins, l_pinhits;
    21
    22 if ( i in (1,1000) )
    23 then
    24 if ( i = 1 )
    25 then
    26 l_sgets := l_gets; l_sgethits := l_gethits;
    27 l_spins := l_pins; l_spinhits := l_pinhits;
    28 end if;
    29 dbms_output.put_line
    30 ( l_ns || to_char(l_gets,’999,999′) ||
    31 to_char(l_gethits,’999,999′) ||
    32 to_char(l_pins,’999,999′) ||
    33 to_char(l_pinhits,’999,999′) );
    34 if ( i = 1000 )
    35 then
    36 dbms_output.put_line
    37 ( l_ns || to_char(l_gets-l_sgets,’999,999′) ||
    38 to_char(l_gethits-l_sgethits,’999,999′) ||
    39 to_char(l_pins-l_spins,’999,999′) ||
    40 to_char(l_pinhits-l_spinhits,’999,999′) );
    41 end if;
    42 end if;
    43 end loop;
    44 end;
    45 /

    Procedure created.

    sys@ORA10G> alter system set session_cached_cursors=100 scope=spfile;

    System altered.

    sys@ORA10G> alter system set cursor_space_for_time=TRUE scope=spfile;

    System altered.

    sys@ORA10G> startup force
    ORACLE instance started.

    Total System Global Area 171966464 bytes
    Fixed Size 777956 bytes
    Variable Size 145760540 bytes
    Database Buffers 25165824 bytes
    Redo Buffers 262144 bytes
    Database mounted.
    Database opened.
    sys@ORA10G> @connect /
    sys@ORA10G> set termout off
    ops$tkyte@ORA10G> @login
    ops$tkyte@ORA10G> set termout off
    ops$tkyte@ORA10G> REM GET afiedt.buf NOLIST
    ops$tkyte@ORA10G> set termout on
    ops$tkyte@ORA10G> exec p
    SQL AREA 1,181 373 4,828 4,171
    SQL AREA 1,181 373 4,828 4,171
    SQL AREA 0 0 0 0

    PL/SQL procedure successfully completed.

    可以看到10g的pl/sql引擎也有了变化。

    再来看一下设置session_cached_cursors后handle的dump

    BUCKET 110279:
    LIBRARY OBJECT HANDLE: handle=9df283a8 mutex=0×9df2845c(1)
    name=select namespace, gets, gethits, pins, pinhits from v$librarycache where namespace = ‘SQL AREA’
    hash=f1deb637acf7a42dd55d86a8ae3baec7 timestamp=08-30-2005 17:07:35
    namespace=CRSR flags=RON/KGHP/TIM/KEP/PN0/MED/KST/DBN/MTX/[500100d4]
    kkkk-dddd-llll=0001-0001-0001 lock=N pin=0 latch#=7 hpc=0002 hlc=0002

    而不设置的话
    BUCKET 110279:
    LIBRARY OBJECT HANDLE: handle=9df283a8 mutex=0×9df2845c(1)
    name=select namespace, gets, gethits, pins, pinhits from v$librarycache where namespace = ‘SQL AREA’
    hash=f1deb637acf7a42dd55d86a8ae3baec7 timestamp=08-30-2005 17:07:35
    namespace=CRSR flags=RON/KGHP/TIM/KEP/PN0/MED/KST/DBN/MTX/[500100d4]
    kkkk-dddd-llll=0001-0001-0001 lock=0 pin=0 latch#=7 hpc=0002 hlc=0002

    如果执行alter system flush shared_pool 那么没有加载null mode lock的handle将被flush出shared pool。

  • loadrunner错误Error: Function two_way_comm_create_connector failed.

    2011-02-23 11:13:05

      本想利用loadrunner来实现扩充一下JAVA的并发用户数量,但是现在跑10个用户 ;线程池的大小是3个并发 ... 遇到这样的问题:
      1.Error: Two Way Communication Error: Function two_way_comm_create_connector failed.
      2. Error: Two Way Communication Error: Function two_way_comm_post_message / two_way_comm_post_message_ex failed.
      3. java Abnormal termination, caused by mdrv process termination.
      4. Error: Communication error: Cannot send the message since reached the shared memory buffer max size.
     
      上网上查看别人的提问, 听说需要打一个补丁: CPT 12533补丁(controller crash) 
     
      可惜没有找到.... 可怜的商业工具... 信息总是那么的不公开啊...
  • loadrunner不支持java多线程

    2011-02-21 18:06:47


    =========java代码=========================
    import java.io.IOException;
    import java.net.URL;
    import java.util.concurrent.ExecutorService;
    import java.util.concurrent.Executors;
    import java.util.concurrent.Semaphore;
    public class TT {
    public static void main(String[] args) {
    // 线程池
    ExecutorService exec = Executors.newCachedThreadPool();
    // 只能5个线程同时访问
    final Semaphore semp = new Semaphore(10);
    // 模拟20个客户端访问
    for (int index = 0; index < 20; index++) {
    final int NO = index;
    Runnable run = new Runnable() {
    public void run() {
    try {
    // 获取许可
    semp.acquire();
    int c;

    try {
     URL url = new URL("http://localhost:7080/webjava/");    
     java.net.URLConnection uc = url.openConnection();
     java.io.InputStream in =  uc.getInputStream(); 
     System.out.println("Accessing: " +NO +"   "+ in.toString());
     in.close();
    } catch (IOException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
    }      
    //System.out.println("Accessing: " + NO);
    //Thread.sleep((long) (Math.random() * 10000));
    // 访问完后,释放
    semp.release();
    } catch (InterruptedException e) {
    }
    }
    };
    exec.execute(run);
    }
    // 退出线程池
    exec.shutdown();
    }
    }
     
     
    ===========loadrunner 代码============
     

     public int init() throws Throwable {
      return 0;
     }//end of init

     public int action() throws Throwable {
               // Tweb.main((String []) null);
                TT.main((String []) null);
      return 0;
     }//end of action

     public int end() throws Throwable {
      return 0;
     }//end of end
     
     
    在Vuser中测试通过,但是在controller里面报如下的错误
    错误1:   Abnormal termination, caused by mdrv process termination.
     
    错误2:
      Error (-17998): Failed to get [param not passed in call] thread TLS entry.
     
    初步估计是loadrunner防止别人扩充 JAVA多线程的特点,故意做一个限制.唉...不知道是不支持呢,还是别的原因....
  • Junit 包含参数列表的测试用例一起执行

    2011-01-26 18:02:38

    ============包含参数列表的 多个测试用例一起执行=====================
    package fnew;
    import org.junit.runner.RunWith;
    import org.junit.runners.Suite;
    import org.junit.runners.Suite.SuiteClasses;
    /**
      * @描述:util包的测试套件
     */
    @RunWith(Suite.class)
    @SuiteClasses
    ({FmoneyTest.class,DivTest.class})   //是执行的测试类,用逗号分开不同的测试类.
    public class Util4Suite {
     
    }
    =======================================================
    package fnew;
    import junit.framework.Test;
    import junit.framework.TestSuite;
    public class AllTests {
     public static Test suite() {
      TestSuite suite = new TestSuite("Test for fnew");
      //$JUnit-BEGIN$
      suite.addTestSuite(JianFa.class);       //要测试的类
      suite.addTestSuite(DivTest.class);      //要测试的类
      suite.addTestSuite(FmoneyTest.class);   //执行失败,提示错误,无法执行也是说这个方法不能用来执行带有虚函数的类
      //$JUnit-END$
      return suite;
     }
    }
     本测试方式 使用于没有构造方法的类 .... 本人实验已经通过了.
  • Junit

    2011-01-26 11:23:29

    /*单个测试类 进行测试*/

    import static org.junit.Assert.*;

    import org.junit.Test;
    import junit.framework.TestCase;


    public class JiaFaTest extends TestCase {
     
     @Test
     public   void testJiafa() {
      //fail("Not yet implemented");
      JiaFa t=new JiaFa();
      assertEquals(-2147483639,t.jiafa(2147483647, 10));
     }

    }

    ------------------------------------------

    增加测试suite

    import junit.framework.Test;
    import junit.framework.TestSuite;


    public class AllTests1 {

     public static Test suite() {
      TestSuite suite = new TestSuite("Test for default package");
      //$JUnit-BEGIN$
      suite.addTestSuite(ParameterTest.class);
      suite.addTestSuite(JiaFaTest.class);
      suite.addTestSuite(JianFaTest.class);
      suite.addTestSuite(DivTest.class);
      suite.addTest(AllTests.suite());
      //$JUnit-END$
      return suite;
     }

    }
    ----------------------------------------

    [被测试类


    public class JiaFa {
     public int jiafa(int a ,int b){
      return a+b;  
     }

    }

       几天的捉摸都算是明白了junit的基本用法,但是如果复杂的测试,这种代码就很可怜了.. 根本不够用的.

       还在不停的学习中...


     

  • junit 参数化

    2011-01-26 11:21:54

      
     
    import static org.junit.Assert.assertEquals;  
     
    import java.util.Arrays;  
    import java.util.Collection;   

    import junit.framework.TestCase;

    import org.junit.Test;  
    import org.junit.runner.RunWith;  
    import org.junit.runners.Parameterized;  
    import org.junit.runners.Parameterized.Parameters;   
     
    /** 
     * 参数化设置 
     *  
     * 1 测试类必须由parameterized测试运行器修饰 
     * 2 准备数据,数据的准备需要在一个方法中进行,该方法需要满足一定的要求 
     *   1)该方法必须有parameters注解修饰 
     *   2)该方法必须为public static的 
     *   3)该方法必须返回Collection类型 
     *   4)该方法的名字不作要求 
     *   5)该方法没有参数 
     *    
     *   int.class == Integer.TYPE != Integer.class 
     */ 
    // 测试运行器  
    @RunWith(Parameterized.class)  
    public class ParameterTest extends TestCase {  
        private int expeted;  
        private int input1;  
        private int input2;  
          
        @Parameters 
        @SuppressWarnings("unchecked")  
        public static Collection perpareData() {  
            Object[][] bjects = { {3,1,2}, {0,0,0}, {-4,-1,-3} };  
              
            return Arrays.asList(objects);  
        }  
          
        public ParameterTest(int expected, int input1, int input2){  
            this.expeted = expected;  
            this.input1 = input1;  
            this.input2 = input2;  
        }  
          
        @Test
         public void testAdd() {  
            Calculator cal = new Calculator();  
            assertEquals(expeted, cal.add(input1, input2));  
        }  

    ===========================================

    被测试类
    public class Calculator {

     public int add(int a,int b){
      
      int c ;
      c= a + b;
      return c;
     }
    }

  • 晚上八九点钟的太阳

    2011-01-17 18:16:36

     

    晚上八九点钟的太阳

       献给软件测试和质保人员

     我更喜爱晚上八九点钟的太阳,

    虽然人们都已把他遗忘,

    但他还是艰难地悬挂在天上。

    我更喜爱晚上八九点钟的太阳,

    因为他将奏出黎明的交响。

    没有他

    又怎会呼唤出一片明亮?

     

    我更喜爱晚上八九点钟的太阳,

    因为他会化成早上的朝阳。

    没有他

    又怎会有什么希望?

    我更喜爱晚上八九点钟的太阳,

    因为他是上帝的臂膀。

    没有他,

    又怎会创造万物的光芒。

     

    狼人望月嚎叫,

    它知道

    月亮映出的太阳之光,

    终将化为银弹,

    射入它的胸膛。

     

    更喜爱

    晚上八九点种的太阳。

  • 质量的死对头是缺陷

    2011-01-17 18:15:49

     
    u质量的死对头是缺陷(defect,bug),缺陷是混在产品中的人们不喜欢、不想要的东西,它对产品没有好处只有坏处。缺陷越多质量越低,缺陷越少质量越高,提高软件质量的基本手段是消除软件缺陷。
    u中国郎中看病的故事

                 在中国古代,有一家三兄弟全是郎中。其中老三是名医,人们问他:“你们兄弟三人谁的医术最高?”

                 他回答说:“我常用猛药给病危者医治,偶尔有些病危者被我救活,于是我的医术远近闻名并成了名医。我二哥通常在人们刚刚生病的时候马上就治愈他们,临近村庄的人说他是好郎中。我大哥不外出治病,他深知人们生病的原因,所以能够预防家里人生病,他的医术只有我们家里才知道。”

    u郎中三兄弟是三种治病方式的代言人。
     
    u老大治病的方式最高明,如果人们能够预防生病的话,那么没病就用不着看医生了。
    提高软件质量最好的办法是:在开发过程中有效地防止工作成果产生缺陷,将高质量内建于开发过程之中。主要措施是不断地提高技术水平,不断地提高规范化水平,其实就是练内功,通称为软件过程改进
    u即使一个人严守养生之道,身体状况良好,但总是会意外地得病的,得了病就要去看医生。老二治病的方式就是医院的模式,病人越早看病,就越早治好,治病的代价就越低。
    同理,在开发软件的时候,即使人们的技术水平很高,并且严格遵守规范,但是人非机器,总是会犯错误的,因此无法完全避免软件中的缺陷。
    当工作成果刚刚产生时马上进行质量检查,及时找出并消除工作成果中的缺陷。这种方式效果比较好,人们一般都能学会。最常用的方法是技术评审、软件测试和过程检查,已经被企业广泛采用并取得了成效。
    u老三治病的方式代价最高,只能是不得已而为之。可在现实之中,大多数软件企业采用老三的方式来对付质量问题。典型现象是:在软件交付之前,没有及时消除缺陷。当软件交付给用户后,用着用着就出错了,赶紧请开发者来补救。可笑的是,当软件系统在用户那里出故障了,那些现场补救成功的人倒成了英雄,好心用户甚至还寄来感谢信。
  • SQL执行顺序

    2011-01-05 14:30:52

    -查询的逻辑执行过程,来自技术内幕

     

    (8)  SELECT (9) DISTINCT (11) <TOP_specification> <select_list>

    (1)  FROM <left_table>

    (3)    <join_type> JOIN <right_table>

    (2)      ON <join_condition>

    (4)  WHERE <where_condition>

    (5)  GROUP BY <group_by_list>

    (6)  WITH {CUBE | ROLLUP}

    (7)  HAVING <having_condition>

    (10) ORDER BY <order_by_list>

     

    --------------------------------------------------------------------------------------

     

    1.FROM:对FROM子句中前两个表执行笛卡尔积 生成虚拟表VT1

    2.ON:对VT1表应用ON筛选器 只有满足 <join_condition>为真的行才被插入VT2

    3.OUTER(JOIN):如果指定了OUTER JOIN 保留表(preserved table)中未找到的行将行作为外部行添加到VT2 生成T3

    如果FROM包含两个以上表 则对上一个联结生成的结果表和下一个表重复执行步骤1和步骤3 直接结束

    4.WHERE:对VT3应用WHERE筛选器 只有使 <where_condition>TRUE的行才被插入VT4

    5.GROUP BY:按GROUP BY子句中的列列表 VT4中的行分组 生成VT5

    6.CUBE|ROLLUP:把超组(Supergroups)插入VT6 生成VT6

    7.HAVING:对VT6应用HAVING筛选器 只有使 <having_condition>TRUE的组才插入VT7

    8.SELECT:处理SELECT列表 产生VT8

    9.DISTINCT:将重复的行从VT8中去除 产生VT9

    10.ORDER BY:将VT9的行按ORDER BY子句中的列列表排序 生成一个游标 VC10

    11.TOP:从VC10的开始处选择指定数量或比例的行 生成VT11 并返回调用者

  • Library cache 

    2010-12-30 11:07:53

    第一小结  library cache 的内存结构



    Library cache的作用,最主要的就是存储已解析的SQL声明,避免硬解析。我们可以通过一个视图V$librarycache来了解Library cache点中率,已此来评估SQL声明的解析情况。应时时注意此视图中点中率情况,好及时发现并解决问题。
    一、Library cache中所存储的信息:
    1. 按对象类型分类:
    共享游标(SQL and PL/SQL objects)、数据库对象(tables, indexes, and so on)
    2. 按存在时间分类:
    存贮对象:如表、索引、视图等(老化后 磁盘上还有 所以叫永久存储 并不是永久存储在LIBRARY 中)
    瞬时对象:如游标(老化后就没有了)(简单了解在Library cache中数据库对象的信息是什么)
    二、Library cache中如何存储信息 
    了解Library cache的简单原理,对于理解一些调优概念,是十分必要的。 
    共享池内存的结构,是计算机中常用的哈希表形式的扩展。常用的哈希表形式,总是先有一个哈希表,保存对象地址(或句柄),然后,根据对象地址(或句柄)访问对象,计算机中常以这种方式组织数据。其基本形式如下:


    [attach]292840[/attach]

    注意地址和句柄的区别,一般来说,地址只是一个位置信息。而句柄,除了位置,还包含一些其他信息。
    还要注意“堆(Heap)”的概念,程序开发者在程序员使用系统函数分配的内存。
    注:此处补充一点概念,除了堆之外,还有栈,也是内存中比较常见的名词。开发者在程序中定义的各种变量,就在栈中分配。
    上图每一组哈希值、链表头,叫做一个哈希桶。简单的说就是:哈希桶(Hash Bucket)指向对象句柄(Object Handles),对象句柄存有对象所占的堆内存的地址。由于对象的堆往往不只一个,Oracle习惯称这些堆为子堆。通常,对象句柄中存有0号子堆的地址,而0号子堆中存有其他各个子堆的地址,而Library cache中所存贮对象的信息,就在从0号开始的各个子堆中。


    第二小节 Library cache的PIN与LOCK


    一、详述Library cache lock与Library cache pin
    1.
    Library cache lock与Library cache pin的模式。
           所有在Library cache中的对象,都由两部分组成,一个句柄、至少一个子堆。这一点可以参考上面的图。
    句柄中记录的有对象的名字、命名空间、Lock的持有者和等待者、Pin的持有者和等待者、一些标志信息,最重要的,句柄中记有堆的地址。
    在Library cache中寻找对象时,先计算HASH值,在HASH表中找到句柄,再经由句柄,找到对象实际的内存地址。在这个过程中,有两个重要的数据项需要被锁保护起来。一个是对象句柄、另一个就是对象的内存堆。在对象句柄上加的锁就是Library cache lock,在内存堆上加的锁,就是Library cache pin。
    下面先讨论一下Library cache lock。
    (1)。 Library cache lock
    Locks 除了阻止不相容的对句柄的访问,以保护句柄中数据的完整性外,获得Locks也是在缓存中定位对象的唯一方式,即:进程在对句柄上加锁的同时,完成在内存中定位堆的操作。
    在句柄上获得Lock、并在内存中定位到堆后,对象可以Pin自己的堆。如果对象相关信息不在内存中,Pinning一个对象将导致它和它的的子堆被装载(此种情况时,如果是多个对象Pin一个对象,将可能会造成Pin等待)
    Lock 有三种模式
      · Share(s) : 读对象
      · Exclusive(x) : 修改或创建对象
      · Null(n) : 专用于为会话持续
    注意: 存贮对象可以被锁在以上任意一种方式,瞬时对象只能被锁在Null方式。
    Null 锁在执行SQL声明的解析阶段被获得,此后一直持有。它不阻止任何DDL。也用术语“易碎解析锁”称乎它(breakable parse lock)。
    在以下两种情况下Null锁被打碎:
    · 当锁所在对象有一个独占Pin时
    · 锁所在对象的任何依赖对象有一个独占Pin时
    (2)。Library cache pin:
    Pin有两种模式:
    · Share (s) : 读一个对象堆
    · Exclusive (x) : 修改一个对象堆
    无论存贮对象还是瞬时对象,都能被Pinned在Share或Exclusive模式。当修改对象时,进程首先会以Share模式Pin对象,进行错误和安全检查,然后在以Exclusive模式Pin住对象。Pin的解除将会导致相关对象上的易碎锁Break
    不同类型的操作所需要的不同类型的lock/pin:
    1).
    所有的DDL操作都会在需要处理的对象上放一个Exclusive(排他)类型的Lock和Pin(仅仅当执行的时候加上)。
    如:重编译,截断表,给对象授权,等等
    2).
    所有对对象的使用都需要一个null类型lock和shared类型的pin(仅仅当执行的时候加上)。如:使用视图,执行过程,等等。
    以上规则,也同样应用于对象所有依赖的对象。如:一个依赖于其他视图的视图,一个依赖于其他包的包。

    下面我们用一个例子,来验证一下Library cache lock/pin。
    例10:观察Library cache lock/pin 的状态:
    先建立一下如下过程:
    create or replace procedure jj_cur is
    cursor aa is select kglhdlmd,kglhdpmd 
    from x$kglob where kglnaobj='select * from aa_1 where id=1' and kglhdadr<>kglhdpar;

    kk number:=5;

    kk1 number:=5;

    begin

    for i in 1..2000 loop

    kk:=5;

    kk1:=5;

    open aa;

    fetch aa into kk,kk1;

    dbms_output.put_line(kk||'-'||kk1);

    close aa;

    end loop;


    end;
    /
    Kglhdadr是游标句柄,而Kglhdpar是父游标句柄,条件中的kglhdadr<>kglhdpar ,目的是只显示子游标。Kglhdlmd是Library cache lock的模式,为0时表示没有锁,1是NULL锁,2是共享锁,3是独占锁。Kglhdpmd是Library cache pin的模式,0是没有Pin,2是共享Pin,3是独占Pin。
    另外,我们作为测试用的SQL声明select * from aa_1 where id=1,要保证只有一个子游标,这样做的目的,就是让过程中的游标AA只选出来一条记录。在过程执行完毕后,最好再执行声明:select kglhdlmd,kglhdpmd from x$kglob where kglnaobj='select * from aa_1 where id=1' and kglhdadr<>kglhdpar一次,看一下能选出来几行,如果多于一行,说明声明子游标的数量多于一条,应该换一条声明再试。
    在会话A中:
    spool e:\oracle\aaa.txt
    exec jj_cur;
    在会话B中:
    select * from aa_1 where id=1;
    在会话A中:
    spool off
    查看e:\oracle\aaa.txt,可以看到,在会话B的声明执行时:Library cache lock先是1,然后是0。而Library cache pin先是3,后是2,然后是0。会话B中的声明是第一次执行,这是硬解析,所以会有很短时间的独占Pin。上面的例子,可以再试一次,这次,就是软解析了。试验过程同上,结果是,Library cache lock仍是1,然后是0,而Library cache pin则是2,然后是0,不再有3了。
           我们可以再用上面的方法,测试一下父游标上的锁的情况,这里就略过了。
           我记得有资料上说,声明在解析时,在父、子游标上会有独占锁的,但是在上面的测试中,却没有看到。有可能是我的过程执行速度不过快,无法捕找到句柄上的独占锁。 library.GIF (17.71 KB)
  • loadrunner v11 新特性

    2010-11-03 17:41:54

    loadrunner v11 兼容IE8.0
    V11.版本还有许多的新功能如:

    What's New

    Protocols

    • Ajax TruClient - An advanced protocol for modern JavaScript. based applications (including Ajax) emulating user activity within a web browser. Scripts are developed interactively in Mozilla Firefox.
    • Silverlight - A new protocol for Silverlight based applications emulating user activity at the transport level. Allows generating high level scripts by automatically importing and configuring WSDL files used by the application.
    • Java over HTTP - A new protocol designed to record java-based applications and applets. It produces a Java language script. using web functions. This protocol is distinguished from other Java protocols in that it can record and replay Java remote calls over HTTP.
    • Citrix
      • The Citrix Protocol now supports Citrix Online Plugin versions 11.2 and 12.0.
      • Added support for Citrix XenApp Server 5.0
    • Oracle NCA - NCA Java object property support now provides automated creation and registration within a script. of a query-answer table of communication between client-side Java objects and the Oracle NCA server.
    • SAPGUI - Added support for SAPGUI for Windows Client version 7.20.
    • Service Test - The LoadRunner Controller can run scripts created in HP Service Test 11.00, HP's solution for creating and running automated tests for SOA and headless technologies. Refer to the Service Test documentation for details of creating Service Test scripts for a load testing scenario.

    Features

    • Data Format Extension (DFE) - Enhanced data format capabilities for the Web (HTTP/HTML) protocol family. Allows converting raw HTTP traffic into a maintainable and structured XML format and enables correlations by XPATH.
    • Correlation Studio - Web (HTTP/HTML) automatic correlation mechanism has been enhanced to search for possible correlations in the larger scope of snapshot data created during code generation including data formatted by DFE.
    • Snapshot View - New snapshot view for Web (HTTP/HTML) protocol steps allows viewing complete HTTP traffic in both raw and DFE generated formats.
    • VuGen - HP ALM Integration - Enhanced integration with HP Application Lifecycle Management platform. that serves also Quality Center and Performance Center editions.
    • Windows Support - Added support for Windows 7 and Windows Server 2008. See below for limitations.
    • Analysis Reports - Enhanced Analysis reports are more customizable. Analysis data can be exported to a variety of formats, including Word, Excel, PDF, and HTML. New report templates allow saving report definitions and generating reports based on a template.

    Installation and Configuration Information

    Prerequisite Software

    Specific software needs to be installed before you can install LoadRunner. When you run the LoadRunner installation wizard, if the prerequisite software is not already installed on your computer, the wizard detects which software is missing and provides the option to install it.

    The following prerequisite software needs to be installed:

      • .NET Framework 3.5 SP1
      • Microsoft Data Access Components (MDAC) 2.8 SP1 (or later)
      • Microsoft Windows Installer 3.1
      • Microsoft Core XML Services (MSXML) 6.0
      • Microsoft Visual C++ 2005 SP1 Redistributable Package (x86)
      • Microsoft Visual C++ 2008 Redistributable Package (x86)
      • Web Services Enhancements (WSE) 2.0 SP3 for Microsoft .NET Redistributable Runtime MSI
      • Web Services Enhancements (WSE) 3.0 for Microsoft .NET Redistributable Runtime MSI
      • Strawberry Perl 5.10.1

    System Requirements for VuGen, Controller, and Analysis

    The following table describes the system requirements for installing VuGen, the Controller, or Analysis:

    Processor
    CPU Type: Intel Core, Pentium, Xeon, AMD or compatible
    Speed: 1 GHz minimum. 2 GHz or higher recommended
    Operating System
    • Windows Vista SP2 32-bit
    • Windows XP Professional SP3 32-bit
    • Windows Server 2003 Standard Edition/Enterprise Edition SP2 32-bit
    • Windows Server 2008 Standard Edition/Enterprise Edition SP2 32-bit and 64-bit
    • Windows 7
    Note: VuGen recording is not supported on 64-bit operating systems.
    Memory (RAM)
    Minimum: 2 GB
    Recommended: 4 GB or higher
    Screen Resolution
    Minimum: 1024 x 768
    Browser
    • Microsoft Internet Explorer 6.0 SP1 or SP2
    • Microsoft Internet Explorer 7.0
    • Microsoft Internet Explorer 8.0
    Available Hard Disk Space
    Minimum: 2 GB


    Load Generator for Windows System Requirements

    The following table describes the system requirements for installing the Load Generator on a Windows machine.

    Processor
    CPU Type: Intel Core, Pentium, Xeon, AMD or compatible
    Speed: 1 GHz minimum. 2 GHz or higher recommended
    Note for Pentium Processors: Intel Hyper-Threading technology is not supported. Hyper-Threading can be disabled in the BIOS. For more information, see:
    Operating System
    The following Windows operating systems are supported:
    • Windows Vista SP2 32-Bit
    • Windows XP Professional SP3 32-Bit
    • Windows Server 2003 Standard Edition/Enterprise Edition SP2 32-Bit
    • Windows Server 2008 Standard Edition/Enterprise Edition SP2 32-Bit and 64-bit
    • Windows 7
    Memory (RAM)
    Minimum: 1 GB
    Note: Memory depends on protocol type and system under test and can vary greatly.
    Browser
    • Microsoft Internet Explorer 6.0 SP1 or SP2
    • Microsoft Internet Explorer 7.0
    • Microsoft Internet Explorer 8.0
    Available Hard Disk Space
    Minimum: 2 GB


    Load Generator for UNIX System Requirements

    This section describes the system requirements necessary for installing the HP Load Generator on a UNIX machine.

    Memory (RAM)
    256 MB minimum
    Note: Memory depends on protocol type and system under test and can vary greatly.
    Available Hard Disk Space
    150 MB minimum


    The following table describes the supported operating systems on which you can install a UNIX HP Load Generator.

    OS Type
    OS Version
    Platform.
    Sun Solaris
    • Solaris 9 (2.9)
    • Solaris 10 (2.10)
    Sun UltraSPARC-based systems
    HP-UX
    HP-UX 11iv2 (11.23)
    HP PA-RISC
    Red Hat Linux
    • Enterprise Linux 4.0
    • Enterprise Linux 5.0
    • CPU Type: Intel Core, Pentium, AMD or compatible
    • Speed: 1 GHz minimum. 2 GHz or higher recommended


    Product Compatibility

    LoadRunner 11.00 is compatible with the following HP product versions:

    • HP Quality Center version 10.00
    • HP Application Lifecycle Management version 11.00
    • HP QuickTest Professional versions 10.00 and 11.00
    • HP Diagnostics versions 8.04 and 9.00 (Note: To use Diagnostics 8.x with LoadRunner 11.00, the Diagnostics 9.00 LoadRunner Add-in must be installed. For more details, see the HP Diagnostics documentation)
    • HP SiteScope versions 10.12 and 11.00

    Pre-Installation Notes and Limitations

    This section includes:

    Windows
    • On Vista machines, if you want to add a new license from the LoadRunner Launcher (Configuration > LoadRunner License > New License), you need to have Administrator privileges on the Vista machine.
    • If you are running McAfee or Aladdin's eSafe anti-virus applications, close them before installing LoadRunner.
    • To use Windows 2003 with a HASP plug, download Aladdin's latest HASP driver.
    UNIX
    • The LoadRunner UNIX installation is based on native packages per operating system. This requires you to be logged in as root user to run the installation.
    • If you are installing a UNIX load generator on an HP-UX operating system, you cannot install it from a network location. You can install it directly from the installation disk or you can copy the installer onto the local directory of the target machine.
    Virtual Environment Installation
    • LoadRunner supports Vmware version ESX 3.0, ESX 3.5, and VM Workstation 5.5 and is certified for the following Windows platforms: Windows XP SP2/SP3, Windows Server 2003 SP2, and Windows Vista SP1.
    • Running Vusers on virtual machines may adversely affect performance due to the sharing of physical resources.
    Diagnostics for J2EE/.NET Requirements

    A unique transaction name must be used for each scenario.

    ContentCheck in Multilingual Environments

    This version supports ContentCheck rules in French, German, Spanish, and Italian. The correct language file should be installed according to the system locale.

    The suitable language file can also be copied from the installation disk:

    ..\lrunner\MSI\setup\international\<lang>\dat\LrwiAedInstallation.xml

    to the <LoadRunner>\dat directory.

    Windows Firewall Considerations

    In most Windows environments, Windows Firewall is turned on by default. The firewall does not allow certain LoadRunner components to communicate with each other. The Windows firewall therefore needs to be turned off.

    Note: Turning off Windows Firewall increases the risk to your computer's security.

    For each process that needs the firewall you can unblock the process by clicking the unblock button in the popup window that indicates that the program needs it, or by manually tuning the Windows firewall from the Exceptions tab.

    WAN Emulation
    • Make sure that the relevant 3rd party components are installed on the load generator machines. Note that in addition to the load generators, you may be required to install the relevant 3rd party component on additional LoadRunner components. For more information, see the relevant 3rd party software installation documentation.
    • The relevant 3rd party component licenses must be purchased from the 3rd party vendor and not from HP.
    HP Performance Validation SDK

    HP Performance Validation SDK version 11.00 can be used only with LoadRunner version 11.00 and above.

    Notes and Limitations

    This section includes:

    General

    • To run LoadRunner on Windows 7 or Window Server 2008, you must have Administrator privileges and User Account Control (UAC) must be disabled.
    • Internet Explorer 8
      • For Click and Script. based protocols, address bar operations and pop-up windows are not supported.
      • The Internet Explorer SmartScreen Filter must be disabled when recording with Citrix Web Access (formerly known as Citrix NFuse).
    • Internet Explorer Enhanced Security Configuration should be disabled when recording with Citrix Web Access (formerly known as Citrix NFuse) recording on Windows 2003/2008 Server.
    • WinInet recording is not supported.
    • Recording on 64 bit machines is not supported, however replaying scripts on 64 bit machines is supported.
    • FTP active mode with SSL is not supported in both explicit and implicit flavors.
    • The network speed simulation settings in the Network: Speed Simulation node in the Run Time Settings do not work with Windows 7. Virtual users will use the maximum bandwidth regardless of which option was selected.
    • It is not recommended to install and uninstall a Load Generator standalone installation on the same machine with a VuGen standalone installation.
    • The Load Generator cannot run Citrix scripts in service mode when the script. was recording using Citrix Client version is 11.2 or higher.
    • The Agent icon does not appear in Windows 2008 and Vista when the LoadRunner Agent service is launched.
    • When LoadRunner Agent runs as service (magentservice.exe), files that are stored on remote network drives or referred to by UNC path cannot be accessed (script, parameter file, etc.). If you want to access files this way, run the LoadRunner Agent as process (magentproc.exe). If this is not possible, please contact Customer Support.

    VuGen

    • SAP (Click and Script) recording. During recording, if you use a keyboard option instead of a UI element (for example, pressing Enter instead of clicking the log on button), the step may not be recorded. In general, when recording your script, it is recommended to use UI elements rather than keyboard options.
    • Citrix snapshots. Black snapshots may appear during record or replay when using Citrix Presentation Server 4.0 and 4.5 (before Rollup Pack 3).
    • Possible workaround: On the Citrix server select Start Menu > Settings > Control Panel > Administrative Tools > Terminal Services Configuration > Server Settings > Licensing and change the setting Per User or Per Device to the alternative setting (i.e. If it is set to Per User, change it to Per Device and vice versa.)

    • Recording Window Size and XenApp Plugin for Hosted Applications 11. The recording window size options does not work properly with the XenApp Plugin for Hosted Applications 11. The size of the client window is installed, but the server screen resolution is not. This is a Citrix Client bug and will be fixed in future Citrix Client versions.
    • Workaround: When recording, set the window size equal to the local screen resolution. When replaying/load testing, set the VuGen or Load Generator's screen resolution to equal the resolution used when the script. was recorded. To verify the recorded resolution, view the Window property in the <Script. Folder>\default.cfg file.

    • For the following protocols, replay is supported but recording is no longer supported: Siebel DB2, Siebel MSSQL, Siebel Oracle, and Voice XML.
    • In Test Result reports, you can only use the Export to HTML file utility for scripts replayed in version 9.50 and later. To generate an HTML report for scripts created with earlier versions, run the script. again in the 9.50 version (or later) of the product.
    • If you terminated the Protocol Advisor immediately after the detection process started, the Protocol Advisor may leave a zombie process of the detected application, causing all recordings and detection sessions that follow to fail. Workaround: Manually terminate the zombie process.
    • The new Web snapshot model is backward compatible with previous versions of LoadRunner, however some snapshot data may be missing. If this occurs, regenerate the script.
    • The JSON Data Format Extension does not work in UNIX environments.
    • Recording a network based application on Windows 7. To record a network-based application (including Web), IPv6 communication must be disabled. Follow the instructions in http://www.addictivetips.com/windows-tips/how-to-disable-ipv6-in-windows-7/ to disable IPv6 in Windows 7.
    • For protocols using XML, replay fails to create a request when a parameterized input argument contains the ampersand (&) character.
    Correlation Studio
    • In VuGen, when correlating large amount of snapshot data, in some cases the parameter is not created and data is not correlated.
    • Scan for correlation will work on a script. that was regenerated and replayed with the early access version.

    VuGen Protocols

    AJAX (Click and Script)
    • ActiveX objects and Java applets are only supported on Windows platforms.
    Ajax TruClient
    • The Ajax TruClient protocol can only be used with applications that support the Mozilla Firefox browser.
    • Documentation and further limitations about this protocol will be provided separately.
    Citrix
    • Installation of the registry patch is required for the support of all version of Citrix clients over 10.x. Additionally, you need to install Enable_Citrix_API.reg from the LoadRunner\dat folder on Vugen or LG machines if a Citrix Client will be installed after installing LoadRunner.
    • Running Citrix Vusers on virtual machines may adversely affect performance due to the sharing of physical resources.
    • Citrix XenApp Desktop cannot be recorded with Citrix Web Access (formerly known as Citrix NFuse) if Desktop View (Desktop Toolbar) is enabled.
    • Citrix Agent text trapping does not work on Citrix servers installed on Windows Server 2008.
    Click and Script. (All)
    • Does not support VBScript
    • Does not support user actions on ActiveX objects and Macromedia Flash
    • Scalability is lower than the Web HTML protocol, depending on the size and functionality of the business process
    • Replay snapshots may differ from the actual Web page
    • Support of right-to-left languages is limited (e.g., bi-directional or reversed text may not be processed as expected). This is defined by the default operating system translation table.
    • Recording of an application in a specific language (e.g., French, Japanese) must be performed in a machine whose default locale (in Settings > Control Panel > Regional Options) is the same language
    • The locale of the load-generator machine, including the default non-Unicode character set, must be configured to be the same as that of the recording machine. It cannot be assumed that the UNIX default character set is the same as in Windows, even for US-English machines, and this has to be explicitly verified. For example, the default character set in some UNIX machines, such as Linux, is UTF-8.
    • The Recording Options dialog box may take a long time to open.
    • Citrix Clients 11.2 and higher do not support the TCP/IP mode in the Citrix > Login node of the Recording Options dialog box.
    • When recording Citrix Web Access (formerly known as Citrix NFuse) applications, set the window size to "No preference" in the Citrix XenApp web portal preferences page.
    • Web (Click and Script) no longer supports replay of Applets and ActiveX objects. This functionality is now part of the AJAX (Click and Script) protocol.
    Java (All)
    • Java Record Replay Protocol: Recording of JMS applications requires JDK version 1.6u17 or lower.
    • Java over HTTP Protocol: Requires the JDK version 1.5 or higher.
    Listing Directory Service (LDAP)
    • If an LDAP version 3 script. fails during replay, modify the mldpa_logon_ex statement to specify the version number by adding "Version=3" after "URL=.."
    • When recording LDAP scripts, the binary parameter values for certain LDAP functions (such as mldap_add or mldap_modify) are not recorded. Recording of binary parameters is part of the protocol's extended functionality and is not supported by VuGen.
    Media Player (MMS)

    Media Player scripts fail with the error: Error -86801:Host access denied, <hostname> not available or missing.

    Workaround: Call the mms_disable_host_check function in all Media Player scripts.

    Microsoft .NET
    • When the application under test retrieves a server-activated object by calling new RemoteObject(), VuGen generates a RemotingServices.Connect function.
    • Applications using multiple processes or multiple application domains are only partially supported.
    Microsoft Remote Desktop Protocol (RDP)
    • Clipboard sharing supports only short simple textual content.
    • When recording with RDP Agent, applications which were developed using CBuilder may not record properly.
    • RDP 6.1 is not supported in Windows 7, Windows Server 2008, Windows Vista SP1 and Windows XP SP3.
    SAP (Click and Script)
    • Cannot define transactions to measure time of a subset of steps done in a modal dialog.
    • During recording, if a user double-clicks on a tree-view tree cell outside of its text, VuGen records "Select" instead of "Activate." This results in a missing POST in replay.
    • If the list of retrieved values contains a scroll bar, cannot select an item that requires scrolling in order to get it from the server.
    • Scalability is lower than the SAP Web protocol, depending on the size and functionality of the business process.
    • Does not support the Replace with Alternate Navigation run-time setting.
    • In certain SAP environments (such as 6.20 and 6.40), the replay fails for tests that call the web_element function and select an element whose tag name is "TD".
    SAPGUI
    • Due to a SAP-related bug, do not use the sapgui_tree_set_column_order API function in LoadRunner version 9.5.
    Silverlight
    • REST services do not generate Silverlight service calls however they can be recorded and replayed.
    • You cannot edit the WSDL location in the Protocol and Security Scenario dialog box.
    • The Update button in Silverlight Service node of the Recording Options dialog box is not working (always reporting success).
    • Duplex (Polling) Binding for WCF Web Services is not supported.
    • Silverlight 4 Client is supported, however applications developed using the new communication features such as net.tcp binding are not supported.
    • VuGen snapshot viewer does not support Silverlight controls.
    • The Silverlight Protocol does not support applications which use Japanese, Korean, Simplified Chinese, and Traditional Chinese.
    WAP
    • Cannot record in secure mode. Workaround: Record script. in non-secure mode and then replay it in secured mode.
    • Cannot replay a script. in connection-less mode.
    Web Services
    • In VuGen Tree view, you may experience problems viewing/editing the following types of elements: any_object, CDATA, derived and recursive.
    • For large SOAP envelopes, Record and Replay snapshots are disabled.
    • The Import SOAP feature is not supported for envelopes containing a single element larger than 500KB.
    • The recording of requests with attachments or security is not supported.
    • For Axis toolkit, Web service calls that include both attachments and security are not supported.
    • For .NET toolkit, SOAP version 1.2 is not supported for asynchronous calls.
    • You can enter text strings up to 10 KB to encode to base 64. If your string is larger, use the Get from file option.
    • For Axis toolkit, to use base64Binary encoding in scripts created before version 9.10, you must update your WSDL.
    • VuGen supports Web Service messages over JMS message Queue, but does not support JMS Topics.
    • JMS Bindings Extensions are not supported.
    • All services in your script. should have the same security scenario. This can be configured via the Protocols and Security tab.
    • Asynchronous Web Service calls and custom user handlers are not supported for WCF.
    • The IsNonceIncluded and TimestampFormat properties of web_service_set_security are only supported in Script. view-not in Tree view. LoadRunner cannot replay scripts containing the soa_xml_validate function.
    • Note: For more detailed Web Services limitations, refer to the HP Service Test readme.

    Controller

    Secure Channels
    • You cannot use the Host Security Manager utility to update security settings on UNIX load generators that use rsh (remote shell) to connect to the Controller.
    • You cannot use the Host Security Manager utility to change the security mode of the load generator located over a firewall from off to on.
    • When the load generator is located over a firewall, if the load generator and Controller have different security modes, communication cannot be established.
    • If the Controller machine is using secure channel communication, the MI Listener should not be installed on the same machine as the Controller.
    • If the Controller machine is using secure channel communication, it will not be able to connect to an HP-UX load generator.
    GUI Vusers
    • LoadRunner supports GUI Vuser scripts created using HP QuickTest. GUI Vuser scripts created in WinRunner are no longer supported.
    • Windows Load Generator machines can only run one GUI Vuser at a time. To run multiple GUI Vusers in a load test, you need to open a terminal server session for each GUI Vuser. For more information, see the HP LoadRunner Controller User Guide.
    SiteScope
    • If you are configuring the SiteScope System Resources Graph (System Resources Graphs > SiteScope), you cannot specify a specific SiteScope user account. LoadRunner uses the default SiteScope Administrator user.
    • For Sitescope 9.51 Users: If you want to configure SiteScope monitoring with a SiteScope account other than the default SiteScope Administrator account, you need to explicitly assign a group with monitors to that account in SiteScope.

    Analysis

    • Analysis currently supports Microsoft SQL Server versions 2005 and up.
    • If you are using Microsoft SQL Server 2000, you need to either migrate Analysis data or upgrade the server to 2005. The following two tasks describe how to perform. the migrating and upgrading procedures:

    To migrate old Analysis data to a SQL 2005 server:

    1. From the SQL Server Management Studio, using Object Explorer, connect to an instance of SQL Server Database Engine.
    2. Expand Databases, right-click Analysis database, select Tasks\Copy Database.
    3. Follow the instructions in the wizard.

    To upgrade SQL 2000 to SQL 2005:

    1. Backup Analysis database on the SQL 2000 (http://msdn.microsoft.com/en-us/library/cc966495.aspx)
    2. Uninstall SQL 2000.
    3. Install SQL 2005.
    4. Restore Analysis data from backup. (http://msdn.microsoft.com/en-us/library/ms177429(SQL.90).aspx)
    • If you are using Microsoft SQL Server 2005 to store Analysis data and you apply a global filter on the Analysis graphs, you may receive errors due to a Microsoft limitation. If you receive an error, try and apply the global filter again.
    • If you are using your own policy in an MS SQL server, you may need to add your own account to the Analysis database template (in the <LR Installation>\bin\dat folder).
    • When exporting Analysis reports to MS Word, take into account that the content load may affect the table format within the document.
    • The following Analysis default settings have been modified: Include Think Time is disabled and Generate complete data only is enabled.
    • There is a limitation with MS Access and SQL queries when filtering a large number of transactions (greater than 100).
    • Even after running the <Language> User Interface Pack, the Analysis UI data generated from the sample session (in the <LR Installation>\tutorial folder) will display in English. Filtering on the graphs will fail. Workaround: Re-generate the graphs and then the corresponding language from the <Language> User Interface Pack will display and filtering will work.

    LoadRunner Integration with HP Service Test

    • To use a Demo or Commuter type license in LoadRunner with Service Test, run sntinit.exe from the product installation's bin folder after the installation.
    • To use a Commuter type license in LoadRunner with Service Test, in the WCommute utility, you must choose the entry Feature "Service Test", version 9.0 —not a later version.

    For more information about Service Test licenses, refer to the HP Service Test Installation Guide.

    WAN Emulation

    • There is no backward compatibility between the current LoadRunner/WAN Emulation integration and any previous integrations.
    • The integrated 3rd party software may not comply with accepted Internationalization (I18N) conventions.
    • Selecting either Use bandwidth, or Use custom bandwidth in the Network: Speed Simulation node in the Run Time Settings, may interfere with the WAN Emulation settings and could lead to unexpected behavior.
    • WAN Emulation is disabled if the host used as the Load Generator is also used as the Controller.
    • WAN Emulation is not supported if the load generator is running on a UNIX platform.

    Windows Vista

    • To run LoadRunner on Windows Vista, User Account Control (UAC) must be enabled for users with User privileges. For users with Administrator privileges, UAC can be enabled or disabled.
    • Running the Windows Aero user interface on Vista machines, may slow down VuGen UI performance.
    • On Vista machines, icons may not appear correctly in some dialog boxes.
    • If LoadRunner is installed on a machine running Vista, LoadRunner cannot be integrated with WinRunner.
    • On Vista machines, replay for LDAP scripts recorded over SSL is not supported.
    • If you want to connect to HP Quality Center from a LoadRunner machine running Vista and the Quality Center client is not installed on your machine, you need to have Administrator privileges on the Vista machine.
    • Replaying a VB Vuser on a load generator machine with Windows Vista requires administrator privileges.
    • When running a LoadRunner Agent on a Load Generator machine running Vista, it is recommended that you restart your machine after installing LoadRunner, before running Vusers.
    • When running the LoadRunner Agent service on a Vista machine, the Agent Configuration will not restart the agent service if it is already running. To manually restart the Agent service, Choose Start > Administrative Tools > Services. Select the LoadRunner Agent service and choose Stop from the right-click menu. Restart it by selecting the LoadRunner Agent service and choosing Start from the right-click menu.
    • On Vista machines, when recording with MS Exchange (MAPI) protocol, the read_next_mail and mapi_read_next_mail_ex functions work only once per script, resulting in reading only the first message in the mail box.
    • On Vista machines with UAC enabled, FTP sessions cannot be recorded on Internet Explorer.
    • Workaround: Change the following Internet Explorer options:

      • Disable Protected Mode by clearing the Enable Protected Mode check box under Tools > Internet Options > Security.
      • Check the Every time I visit the webpage option under Tools > Internet Options > General > Browse history > Settings.

    Multilingual Support

    • Language support. LoadRunner only supports English and the native language of the machine's operating system. For example, if you are using Japanese Windows XP, you can work with LoadRunner in Japanese and in English.
    • Installation path. The path in which installation files for LoadRunner are located, and the path in which LoadRunner is installed, can contain only English characters.
    • .NET Framework 3.5 failure. Installing LoadRunner on a localized machine may result in a failure in the .NET Framework 3.5 installation process, and you will be asked to terminate the installation. This happens because the .NET 3.5 Framework installation attempts to download the Framework Language Pack but fails.
    • Workaround: Terminate the LoadRunner installation according to the Installation wizard's instructions and invoke the LoadRunner installation again.

    • Japanese characters in Web (HTTP/HTML) scripts. If you set the advanced recording option to specify the encoding of an application, and the application uses different character encoding for different pages, then the recording log or script. may display invalid Japanese characters. This does not cause any errors in the script. replay.
    • Non-breaking spaces in Web protocols for Far Eastern languages. A non-breaking space (&nbsp; &#160; &#xA0; `\xA0', etc.) cannot be represented in some Far Eastern locale character sets (in which it is considered a lead byte). Instead, non-breaking spaces are converted to regular spaces (` `, `\x20', etc.), both during script. code generation and replay. This may cause replay problems, such as mismatches in length due to eliminating multiple regular spaces. To work around this issue, either:
      • Remove/add space(s) from/to the script. so the comparison succeeds.
      • Specify regular expressions to avoid the issue.
    • Tutorial scripts. After the Language Pack installation, all sessions and scripts in \HP\LoadRunner\tutorial are still in English.
    • Standalone installations. The installation interface of the VuGen and Analysis standalone are in English and not localized.
    • Flex AMF call properties. Multibyte symbols in Flex AMF call properties will be corrupted in the script. text view.

    HP Software Support

    You can visit the HP Software Support Web site at:

    http://www.hp.com/go/hpsoftwaresupport

    This web site provides contact information and details about the products, services, and support that HP Software offers.

    HP Software online software support provides customer self-solve capabilities. It provides a fast and efficient way to access interactive technical support tools needed to manage your business. As a valued support customer, you can benefit by using the support site to:

      • Search for knowledge documents of interest
      • Submit and track support cases and enhancement requests
      • Download software patches
      • Manage support contracts
      • Look up HP support contacts
      • Review information about available services
      • Enter into discussions with other software customers
      • Research and register for software training

    Most of the support areas require that you register as an HP Passport user and sign in. Many also require a support contract. To find more information about access levels, go to:

    http://h20230.www2.hp.com/new_access_levels.jsp

    To register for an HP Passport ID, go to:

    http://h20229.www2.hp.com/passport-registration.html

    Legal Notices

    © Copyright 2010 Hewlett-Packard Development Company, L.P.

    Confidential computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor's standard commercial license.

    The only warranties for HP products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. HP shall not be liable for technical or editorial errors or omissions contained herein.

    The information contained herein is subject to change without notice.


1715/9<123456789>
Open Toolbar