zoukankan      html  css  js  c++  java
  • Jmeter Cluster

    Jmeter 是开源软件,100%纯java应用程序,专门为负载测试和性能测试。

    Jmeter的特性包括:

     1.负载测试和性能测试许多不同的服务器/协议类型:

       

      • Web - HTTP, HTTPS
      • SOAP / REST
      • FTP
      • Database via JDBC
      • LDAP
      • Message-oriented middleware (MOM) via JMS
      • Mail - SMTP(S), POP3(S) and IMAP(S)
      • MongoDB (NoSQL)
      • Native commands or shell scripts
      • TCP

        2.完整的可移植性和纯Java

        3.多线程框架允许并发线程和同步采样,针对不同的功能和单独的线程。

        4.详细的GUI设计能快速建立测试计划和调试。

        5.缓存式和离线式分析测试结果

         6.高度可扩展:

            6.1插入取样器,拓展测试功能;

             6.2负载统计能插入计时器

             6.3数据分析和可视化插件允许很大的可扩展和个性化

             6.4函数可用于提供动态输入一个测试或提供数据操作。

             6.5脚本取样器

          网站http://jmeter.apache.org/包含所有所需的信息如何使用JMeter的工具。请参阅文档菜单和阅读和理解的开始部分和用户手 册。第一个将为您提供必要的信息下载、安装和运行JMeter的工具。用户手册中你还会找到详细的信息关于JMeter测试计划和所有元素可以使用在创建 测试计划。 

    JMeter测试步骤:

    这个简短的教程解释如何使用多个系统执行性能测试。在我们开始之前,有几件事检查:

    1。所有机器需要安装Java和JMeter工具部署。

    2.关掉防火墙系统

    3.所有用户在同一个子网

    4.服务器在同一个子网

    5.Jmter能访问服务器

    6.所有系统确保同一个版本的Jmeter,结果准确

    一旦你确定系统准备好了,设置远程

    本教程假设您已经安装了JMeter所有的系统。JMeter的工作方式是1主控制器启动测试在多个从系统。

    术语:

    在我们开始之前,让我们定义条款和保证的定义是明确的:

    Master:系统运行Jmeter GUI或非GUI,控制测试

    slave:运行的系统jmeter-server,需要从主命令和请求发送到目标系统(s)

    Target:系统运行jmeTarget服务器我们计划性能测试

    步骤:

    1.在slave systems上,进入到jmeter/bin目录,打开jmeter-server.sh

    2.定义RMI_HOST_DEF,增加机器的Ip:

      RMI_HOST_DEF=-Djava.rmi.server.hostname=172.48.0.115

    3.执行jmeter-server

    [devops@ssoperf-jmeter-cluster-02 bin]$ ./jmeter-server

    服务正常,出现如下提示:

    Created remote object: UnicastServerRef [liveRef: [endpoint:[172.48.0.115:37675](local),objID:[2dadf396:14fdafc8a0e:-7fff, 25749104862551184]]]

    4.在主系统作为控制台,去jmeter / bin目录并打开jmeter。属性文件在一个文本编辑器

    5.编辑行“remote_hosts = 127.0.0.1”和添加的IP地址。

    例如:remote_hosts=172.48.0.115,172.48.0.116,172.48.0.123

    6.JMeter脚本创建的(如sso.jmx)。

    7.master开始测试:

    /jmeter.sh -Djava.rmi.server.hostname=172.48.0.114 -n -GstartPhoneNumber=10000 -Gthreads=40 -Gloops=50 -Glogin_loop=10 -Gvalidate=100 -t sso.jmx -r -l results.csv -X

    master控制jmeter服务器,启动和停止加载,并从服务器手机统计信息。

    命令行选项的列表:

    -t, --testfile {argument}

            the jmeter test(.jmx) file to run containing the test plan

    -l, --logfile {argument}

            the file to log samples to

    -n, --nongui

            run JMeter in nongui mode

    -J, --jmeterproperty {argument}={value}

            Define additional JMeter properties

    -G, --globalproperty (argument)[=(value)]

            Define Global properties (sent to servers)

            e.g. -Gport=123

             or -Gglobal.properties

    -D, --systemproperty {argument}={value}

            Define additional System properties

    更多命令在:http://jmeter.apache.org/usermanual/get-started.html#options

    debugging:

    Once you started the test in the master system console you will see the following text:

    Creating summariser <summary>

    Created the tree successfully using sso.jmx

    Configuring remote engine: 172.48.0.115

    Configuring remote engine: 172.48.0.116

    Configuring remote engine: 172.48.0.123

    Starting remote engines

    Starting the test @ Thu Sep 17 19:47:12 HKT 2015 (1442490432475)

    Remote engines have been started

    Waiting for possible shutdown message on port 4445

     

    On the slaves you will see the following log for test start and stop:

    Starting the test on host 172.48.0.115 @ Thu Sep 17 19:47:19 HKT 2015 (1442490439214)

    Finished the test on host 172.48.0.115 @ Thu Sep 17 19:47:30 HKT 2015 (1442490441165)

    During the test run the master will receive summary information from the slaves regarding the transactions per seconds, latencies and errors.

    e.g.

    summary +   6803 in     3s = 2293.7/s Avg:     2 Min:     0 Max:    24 Err:     0 (0.00%) Active: 10 Started: 10 Finished: 0

    summary + 101500 in    30s = 3381.9/s Avg:     2 Min:     0 Max:    61 Err:     0 (0.00%) Active: 10 Started: 10 Finished: 0

    summary = 108303 in    33s = 3284.0/s Avg:     2 Min:     0 Max:    61 Err:     0 (0.00%)

    summary + 101100 in    30s = 3370.2/s Avg:     2 Min:     0 Max:    40 Err:     0 (0.00%) Active: 10 Started: 10 Finished: 0

    summary = 209403 in    63s = 3325.1/s Avg:     2 Min:     0 Max:    61 Err:     0 (0.00%)

    summary + 102900 in    30s = 3430.8/s Avg:     2 Min:     0 Max:    45 Err:     0 (0.00%) Active: 10 Started: 10 Finished: 0

    summary = 312303 in    93s = 3359.2/s Avg:     2 Min:     0 Max:    61 Err:     0 (0.00%)

    summary + 101800 in    30s = 3393.3/s Avg:     2 Min:     0 Max:    47 Err:     0 (0.00%) Active: 10 Started: 10 Finished: 0

    summary = 414103 in   123s = 3367.5/s Avg:     2 Min:     0 Max:    61 Err:     0 (0.00%)

    summary +  85897 in    26s = 3334.9/s Avg:     2 Min:     0 Max:    42 Err:     0 (0.00%) Active: 0 Started: 10 Finished: 10

    summary = 500000 in   149s = 3361.6/s Avg:     2 Min:     0 Max:    61 Err:     0 (0.00%)

    Tidying up remote @ Wed Jul 01 19:43:25 EEST 2015 (1435769005812)

     

    To stop the test just execute:

    ./stoptest.sh

    Limitations

    1。RMI不能沟通跨子网没有代理,所以也不能jmeter没有代理。

    2。从JMeter发送所有的测试结果控制控制台,很容易饱和网络IO。这是一个好主意使用简单的数据作家保存结果和查看文件之后,一个图的听众。

    3 所示。一个JMeter 2-3Ghz CPU上运行客户端能处理300 - 600线程根据测试的类型。(唯一的例外是web服务)。XML处理CPU密集型和将很快消耗CPU周期。作为一般规则,以XML为中心的应用程序的性能 将执行的4到10低于使用二进制协议的应用程序。

  • 相关阅读:
    HTTP协议 (二) 基本认证
    HTTP协议详解
    Wireshark基本介绍和学习TCP三次握手
    Fiddler 教程
    UNIX网络编程——线程池模式比较(ICE线程池模型和L/F领导者跟随者模式)
    修改一行SQL代码 性能提升了100倍
    修改一行SQL代码 性能提升了100倍
    vector map 多层嵌套使用
    vector map 多层嵌套使用
    应该记住的话
  • 原文地址:https://www.cnblogs.com/yana/p/4914006.html
Copyright © 2011-2022 走看看