性能测试

来源:互联网 发布:第三方数据公司 编辑:程序博客网 时间:2024/04/30 02:47

1、当涉及到多个服务器做集群时,如果CPU或内存等参数相差过大,有可能是负载均衡没有打开,一定要跟开发进行确认。
  如:web服务器44的CPU平均利用率为60%,而52的CPU平均利用率为6%,经开发确认是由于没有打开负载均衡。

2、一定不能懒,方案中写明的从40个并发开始压测,10个递增,一定要记录每次的压测结果,并保存数据(LR的analysis result 和 nmon文件),直到性能拐点为止或满足不了业务要求为止。

3、做关联时有可能发生ERROR:Error -35061:Action.c(161) Error -35061 No match found for the requested parameter "CorrelationParameter_1". Check whether the requested boundaries exist in the response data. Also_ if the data you want to save exceeds 2999999 bytes_ use web_set_max_html_param_len0
     可以用 web_set_max_html_param_len("99999"); 函数增加可保存的关联参数的长度,但是数值过大可能会导致内存溢出。
    
4、关联的参数实例:注:双引号"前要加转义字符\  
  web_reg_save_param_ex( 
   "ParamName=CorrelationParameter_2",
   "LB=<input type=\"hidden\" name=\"applyUuid\" id=\"pccc_uuid\" value=\"",
   "RB=\"/>",
   SEARCH_FILTERS,
   "Scope=All",
   "RequestUrl=*/identityVerify.html*",
   LAST);

5、假如只需一部分跑完整个流程,一部分只跑一段,可用:
  1)创建多个action,然后在controller中的run time setting->run logic中设置不同action的百分比
  2)
  Action()
 {
  int randno; //定义随机数
  randno = rand() % 100 + 1; //随机数为1到100
  
  /*脚本代码*/
  
  if(randno <= 70){
  basicinfo();//如果随机数小于等于70,进行basicinfo中的内容
    }
    else{
     quit();//如果大于70,结束本次迭代
    }
 }

  basicinfo()
 {
    int randno;
    randno = rand() % 100 + 1;
   
    /*脚本代码*/
   
    if (randno <= 70) {
  
   workinfo();//如果随机数小于等于70,进行workinfo中的内容
    }
    else{
        quit();//如果大于70,结束本次迭代
    }
 }
  
  quit()
 {
    //退出
    lr_exit(LR_EXIT_ITERATION_AND_CONTINUE, LR_PASS);
    return 0;
 }

0 0
原创粉丝点击