zoukankan      html  css  js  c++  java
  • Jmeter(四十一)分布式测试(转!)

    寄语路人休掩鼻,活人不及死人香。

                      -------《随园诗话》袁枚

    转自:https://www.cnblogs.com/imyalost/p/8306866.html

    1、修改Contorller配置

    打开Contorller机下jmeter安装文件下的bin目录:jmeter.properties文件,搜索remote_hosts=127.0.0.1,将Agent机的IP和端口写在后面,比如:

     remote_hosts=127.0.0.1,127.0.0.2:80,127.0.0.3:80 

    其中127.0.0.2和127.0.0.3为Agent机的IP,每个Agent机之间用英文半角逗号隔开,修改保存。

    2、启动jemter

    启动jmeter后,设置线程组、配置元件、取样器、监听器等原件,点击“运行-远程启动”:

    可以选择远程启动一个Agent机,或者选择远程全部启动,这样,就可以进行分布式测试了。

    PS:上面的例子中,127.0.0.2和127.0.0.3为举例说明,具体实践请修改为对应的Agent机IP以及端口。

    注意事项

    1、保持Contorller和Agent机器的JDK、jmeter以及插件等配置版本一致;

    2、如果测试数据有用到CSV或者其他方式进行参数化,需要将data pools在每台Agent上复制一份,且读取路径必须保持一致;

    3、确保Contorller和Agent机器在同一个子网里面;

    4、检查防火墙是否被关闭,端口是否被占用(防火墙会影响脚本执行和测试结构收集,端口占用会导致Agent机报错);

    5、分布式测试中,通过远程启动代理服务器,默认查看结果树中的响应数据为空,只有错误信息会被报回;

    6、如果并发较高,建议将Contorller机设置为只启动测试脚本和收集汇总测试结果,在配置文件里去掉Contorller机的IP;

    7、分布式测试中,如果1S启动100个模拟请求,有5个Agent机,那么需要将脚本的线程数设置为20,否则模拟请求数会变成500,和预期结果相差太大。

  • 相关阅读:
    LeetCode 623. Add One Row to Tree
    LeetCode 894. All Possible Full Binary Trees
    LeetCode 988. Smallest String Starting From Leaf
    LeetCode 979. Distribute Coins in Binary Tree
    LeetCode 814. Binary Tree Pruning
    LeetCode 951. Flip Equivalent Binary Trees
    LeetCode 426. Convert Binary Search Tree to Sorted Doubly Linked List
    LeetCode 889. Construct Binary Tree from Preorder and Postorder Traversal
    LeetCode 687. Longest Univalue Path
    LeetCode 428. Serialize and Deserialize N-ary Tree
  • 原文地址:https://www.cnblogs.com/richered/p/10166590.html
Copyright © 2011-2022 走看看