1、 nGrinder是什么
nGrinder是一个免费的、开放源代码的Web性能测试平台。运行在应用中间件服务器中运行。它由一个控制端和多个代理端组成。通过控制端(浏览器访问)建立测试场景,然后通过分发到代理端进行压力测试,是一个分布式的测试场景。
测试过程是基于Jython脚本来模拟浏览器或其他终端使用HTTP协议访问站点来完成的。测试过程中采集的数据将通过动态图和数据表的形式展示出来。用户可以方便的看到tps、以及测试目标机器的cpu和内存等情况。
  nGrinder依赖的其他开源项目:
 Grinder一个开源的Java负载测试框架,它通过很多负载注射器来为分布式测试提供了便利。支持用于执行测试脚本的Jython脚本引擎。
  Cubrid是一个全面开源,且完全免费的关系数据库管理系统。CUBRID为高效执行Web应用进行了高度优化,特别是需要处理大数据量和高并发请求的复杂商务服务。通过提供独特的最优化特性,CUBRID可以支持更多的并发请求,更少的响应时间。
  Jython是一种完整的语言,而不是一个Java翻译器或仅仅是一个Python编译器,它是一个Python语言在Java中的完全实现。
Jython也有很多从CPython中继承的模块库。最有趣的事情是Jython不像CPython或其他任何高级语言,它提供了对其实现语言的一切存
取。所以Jython不仅给你提供了Python的库,同时也提供了所有的Java类。这使其有一个巨大的资源库。
  Spring是一个开源框架,是为了解决企业应用程序开发复杂性由Rod
Johnson创建的。框架的主要优势之一就是其分层架构,分层架构允许使用者选择使用哪一个组件,同时为 J2EE
应用程序开发提供集成的框架。Spring使用基本的JavaBean来完成以前只可能由EJB完成的事情。然而,Spring的用途不仅限于服务器端的
开发。从简单性、可测试性和松耦合的角度而言,任何  Java应用都可以从Spring中受益。
  2、 windows平台的nGrinder配置
  2.1 前提条件
  nGrinder下在:http://sourceforge.net/projects/ngrinder/files/ngrinder-3.2.3/。本次演示使用了tomcat因此需要下载ngrinder-controller-3.2.3-with-tomcat.zip和ngrinder-core-3.2.3-agent-package.zip。
  jdk1.6:下载地址http://www.java.net/download/jdk6/6u10/promoted
/b32/binaries/jdk-6u10-rc2-bin-b32-windows-i586-p-12_sep_2008.exe
  tomcat 6 下载地址:http://tomcat.apache.org/

  2.2 配置控制端
  安装jkd1.6和tomcat
在这就不再累述,配置JAVA_HOME和JRE_HOME,放到系统环境变量的最前面。然后将ngrinder-controller-3.2.3-
with-tomcat.zip加压缩后,放入webapps文件夹下,运行该文件夹下的 startup.bat。将如下图启动成功:

  在浏览器中输入http://localhost:8080/ ngrinder-controller ,进入登录页面,输入用户名密码(用户名admin,密码admin),进入系统,点击右上角admin下拉菜单,选择系统配置,如下图所示:

修改配置如下:

# Set verbose to print the detailed log
#verbose=true
 
# testmode makes some several constraints not applied.
# if testmode is true, security and pluginsupport is disabled.
#testmode=false
 
# true if enabling security manager. The default value is false
#security=true
 
# false if disabling ngrinder usage report. it will send host ip and executed tests number to Goolge Analytics.
# The default value is true
#usage.report=false
 
 
# true if the plugin is enabled.
# This is not the option applied on the fly. You need to restart the controller.
#pluginsupport=true
 
# false if you want to make the user profile fields not mandatory.
# Default value is true.
#user.security=false
 
# the maximum number of agents which can be attached into one test.
#agent.max.size=10
 
# the maximum number of vusers which can be initiated per one agent
#agent.max.vuser=2000
 
 
# the maximum runcount of test per one agent
#agent.max.runcount=10000
 
# the maximum running hour of one test.
#agent.max.runhour=8
 
 
# the listener port of monitor.
monitor.listen.port=13243
 
#provide the base URL of the ngrinder.
#ngrinder.http.url=
 
# the starting port number of consoles which will be mapped to each test.
# This is not the option applied on the fly. You need to reboot to apply this.
#ngrinder.console.portbase=12000
 
# the port number for the agent connection.
ngrinder.agent.control.port=8088
 
# The count of allowed concurrent tests.
#ngrinder.max.concurrenttest=10
 
# How many milliseconds console will wait until all agents are connected.
#ngrinder.max.waitingmilliseconds=5000
 
# select the ip for controller to use.
ngrinder.controller.ipaddress=192.168.68.134
 
# validation timeout in the unit of sec.
#ngrinder.validation.timeout=100
 
# To be compatible with old agents (before 3.1.1), please set following to true.
# If you use the latest version agent, just set it false.
ngrinder.dist.logback=false
 
# From 3.1.1, nGrinder doesn't check the file distribution result to speed up the test execution.
# If your agent is located in the far places or you distribute big files everyday, you'd better to change this to true.
ngrinder.dist.safe=false
 
 
 
 
# If some region has the slow network, it may need the safe distribution by force
#ngrinder.dist.safe.region=
 
# Set the safe distribution threshold to enable safe distribution for specific transfer size by force.
# ngrinder.dist.safe.threshold=1000000
 
# You can point your own rss page on the ngrinder first page.
#ngrinder.frontpage.rss=http://www.cubrid.org/wiki_ngrinder/rss
 
# If you want to provide your own custom help page. please modify this
#ngrinder.help.url=http://www.cubrid.org/wiki_ngrinder/entry/user-guide
 
# language default en/kr/cn is available.
#ngrinder.langauge.default=en
 
# The monitor port is configurable. The default port is 13243.
#monitor.listen.port=13243
 
######################################################################################
# clustering configuration.
# This is not the option applied on the fly. You need to reboot to apply this.
######################################################################################
# These should be very carefully set.
# You can refer http://www.cubrid.org/wiki_ngrinder/entry/controller-clustering-guide
 
# if you want to enable ngrinder controller clustering. please enable below.
#ngrinder.cluster.mode=false
 
# cache cluster uri of all clustered controller servers.
#ngrinder.cluster.uris=192.168.1.1;192.168.2.2;192.168.3.3
 
# cache cluster listener port.
#ngrinder.cluster.listener.port=40003
 
 
# region setting of this controller.
# When running ngrinder as cluster mode, the ${NGRINDER_HOME} should be shared by multiple controllers.
# We expect this to be done by running ${NGRINDER_HOME} on NFS.
# However this option is not to set here. Because each controller in cluster must have system-ex.conf
# which should be stored in ${NGRINDER_EX_HOME} in the local so that each node cluster looks different value. 
# Please locate followings this on the ${NGRINDER_EX_HOME}(by default .ngrinder_ex)/system-ex.conf
# ngrinder.cluster.region=Beijing

  2.3 配置代理端
   将ngrinder-core-3.2.3-agent-package.zip解压,建立环境变量NGRINDER_AGENT_HOME,变量值为C:\DOCUME~1\ADMINI~1\.grinder_agent。
 运行代理文件夹下的startuo.bat后,进入C:\Documents and Settings\Administrator\.ngrinder_agent,修改agent.conf如下:

#start.mode=monitor
#monitor.listen.port=13243
# If you want to monitor bind to the different local ip not automatically selected ip. Specify below field.
#monitor.host=hostname_or_ip
 
start.mode=agent
agent.console.ip=192.168.68.134
agent.console.port=8088
#agent.region=
#agent.hostid=
#agent.servermode=true
 
# provide more agent java execution option if necessary.
#agent.javaopt=
# set following false if you want to use more than 1G Xmx memory per a agent process.
#agent.useXmxLimit=true
#agent.same.console.host=true
# please uncomment the following option if you want to send all logs to the controller.
#agent.send.all.logs=true

其中agent.console.ip为控制端ip,agent.console.port为控制端监听端口。
  3、 应用
  启动nGrinder控制端和代理端,通过http://localhost:8080/ ngrinder-controller 进入登录页输入用户名密码,进入nGrinder平台。在快速测试的url地址框中输入www.cstc.org.cn,点击开始测试。进入如下页面:

  在代理里面输入1,虚拟用户中点击右侧 按钮,输入2个进程,5可形成后,点击右上角的保存并开始测试,测试开始了

等待测试结束后,可以对其进行一下结果的导出等操作。

nGrinder性能测试平台搭建(LVS压力测试)的更多相关文章

  1. 使用Visual Studio Team Services进行压力和性能测试(二)——压力测试执行

    使用Visual Studio Team Services进行压力和性能测试(二)--压力测试执行 1.点击Run test将会该压力测试进行排队,我们将看到等待测试代理屏幕.Visual Studi ...

  2. 性能测试工具 jmeter 分布式压力测试实操

    性能测试工具 jmeter 分布式压力测试实操 本文在Non-GUI Mode下进行,准备好三台有jdk环境,linux操作系统,同一局域网测试机器,运行两台slave,一台master机器,进行分布 ...

  3. Web性能测试篇:AB 压力测试

    1. 压力测试的概念\定义 1.这段话是给刚接触\学习性能测试知识的初学者,在实际工作中都会接触到性能测试.压力测试.负载测试等专业名词也容易混淆,下面带大家熟悉下这到底是怎么定义: 1.1.性能测试 ...

  4. 一个基于.NET平台的自动化/压力测试系统设计简述

    AutoTest系统设计概述 AutoTest是一个基于.NET平台实现的自动化/压力测试的系统,可独立运行于windows平台下,支持分布式部署,不需要其他配置或编译器的支持.(本质是一个基于协议的 ...

  5. 基于locust的性能测试平台搭建

    前段时间加入性能测试组,并参与搭建基于locust的性能测试平台,我分到的任务相对独立,开发locust的启动接口和停止运行接口,现开发的差不多了,做一个总结 一.locust运行的相关内容 二.lo ...

  6. 测者的性能测试手册:Web压力测试工具webbench

    webbench最多可以模拟3万个并发连接去测试网站的负载能力,个人感觉要比Apache自带的ab压力测试工具好,安装使用也特别方便. 1.适用系统:Linux 2.编译安装: wget http:/ ...

  7. 性能测试篇:LoadRunner11 压力测试实例笔记

    最近在学习用loadrunner做web性能测试,简单记录一下一个自学实例流程. 1.录制测试脚本 (1).打开LR11,点击create/edit Script来打开VUgen (2).点击新建 ( ...

  8. Centos6.5搭建分布式压力测试工具Tsung的环境搭建

    各软件版本: 1.otp_src_17.1.tar.gz 2.tsung_1.5.1.tar.gz 3.7.0的Java编译环境 因工作需要,需要用TSung工具测试xmpp协议,经历了一段时间的挣扎 ...

  9. nGrinder性能测试平台的安装部署

    1.从GitHub下载war包: https://github.com/naver/ngrinder/releases 2.把ngrinder-controller-3.4.2.war重命名为ngri ...

随机推荐

  1. Java线程池应用

    Executors工具类用于创建Java线程池和定时器. newFixedThreadPool:创建一个可重用固定线程数的线程池,以共享的无界队列方式来运行这些线程.在任意点,在大多数 nThread ...

  2. javax.servlet.ServletException: com.microsoft.jdbc.base.BaseDatabaseMetaData.supportsGetGeneratedKeys()Z

    javax.servlet.ServletException: com.microsoft.jdbc.base.BaseDatabaseMetaData.supportsGetGeneratedKey ...

  3. PHP函数可变参数列表的具体实现方法介绍

    PHP函数可变参数列表可以通过_get_args().func_num_args().func_get_arg()这三个函数来实现.我们下面就对此做了详细的介绍. AD:2014WOT全球软件技术峰会 ...

  4. 在Windows和UNIX下利用PHP和LDAP进行身份验证

    我现在的老板曾要求我为企业内部的Web服务提供一种标准的身份验证方法.我遇到的一个主要问题就是我们公司主要使用了两种平台:UNIX和.所以,我的第一个想法并不很成功:它要求每个员工都使用UNIX或者L ...

  5. 【转】Dubbo_与Zookeeper、SpringMVC整合和使用(负载均衡、容错)

    原文链接:http://blog.csdn.net/congcong68/article/details/41113239 互联网的发展,网站应用的规模不断扩大,常规的垂直应用架构已无法应对,分布式服 ...

  6. shell expr的用法

    root@tcx4440-03:~# var=$var+1root@tcx4440-03:~# echo $var3+1 要想达到预期结果,用下列三种方法: (1)let "var+=1&q ...

  7. 7.Android之评分条RatingBar和拖动条SeekBar学习

    评分条RatingBar和拖动条SeekBar很常见,今天来学习下. (1)RatingBar评分条 如图: <RelativeLayout xmlns:android="http:/ ...

  8. POJ1703Find them, Catch them

    Find them, Catch them Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 37722   Accepted: ...

  9. Spring学习1-初识Spring

    一.简介   1.Spring是一个开源的控制反转(Inversion of Control ,IoC)和面向切面(AOP)的容器框架.它的主要目得是简化企业开发.  2.为何要使用Spring?   ...

  10. 快速tab应用

    ZCTabNav-master https://github.com/zcsoft/ZCTabNav 层次构架清楚,很适合快速,导入