nGrinder性能测试平台搭建(LVS压力测试)

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可形成后,点击右上角的保存并开始测试,测试开始了

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

转载于:https://www.cnblogs.com/itcomputer/p/5003985.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/419262.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

“睡服”面试官系列第十三篇之函数的扩展(建议收藏学习)

目录 1. 函数参数的默认值 1.1基本用法 1.2与解构赋值默认值结合使用 1.3参数默认值的位置 1.4函数的 length 属性 1.5作用域 1.6应用 2. rest 参数 3. 严格模式 4. name 属性 5. 箭头函数 5.1基本用法 5.2使用注意点 5.3嵌套的箭头函数 6. 双冒号运算符 7. 尾…

如何快速的解决Maven依赖冲突

为什么会出现依赖冲突 首先要说明Maven的依赖管理,具体的可以参考这边 Maven学习——依赖管理 这篇文章,maven在依赖冲管理中有一下几个原则。 依赖是使用Maven坐标来定位的,而Maven坐标主要由GAV(groupId, artifactId, version&…

前端学习(1682):前端系列实战课程之让蛇改变方向

<!DOCTYPE html> <html lang"en"><head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"><title>游戏初始化界面</title><style>body {ma…

第十二周学习总结

信息安全系统设计基础第十二周学习总结 【学习时间&#xff1a;8 小时】 【学习内容&#xff1a;process文件夹中的代码理解和执行、故障排除】 一、代码理解 1.env文件夹-environ.c代码 #include <stdio.h> #include <stdlib.h> int main(void) { printf("PA…

maven依赖仲裁

转载自&#xff1a;http://blog.csdn.net/wanyanxgf/article/details/6617403

前端学习(1683):前端系列实战课程之让蛇吃食物变长

<!DOCTYPE html> <html lang"en"><head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"><title>游戏初始化界面</title><style>body {ma…

cdoj 1246 每周一题 拆拆拆~ 分解质因数

拆拆拆~ Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.uestc.edu.cn/#/problem/show/1246 Description 给你一个数x&#xff0c;你有两个操作 1.分解质因数&#xff0c;如果x是一个合数&#xff0c;那么就将x分解质因数&#xff0c;然后进入操作2&#xff0c;…

当你在浏览器输入一个网址,如http://www.taobao.com,按回车之后发生了什么?请从技术的角度描述,如浏览器、网络(UDP、TCP、HTTP等),以及服务器等各种参与对象上由此引发的一系

1.DNS域名解析&#xff1a;浏览器缓存、系统缓存、路由器、ISP的DNS服务器、根域名服务器。把域名转化成IP地址。2.与IP地址对应的服务器建立TCP连接&#xff0c;经历三次握手&#xff1a;SYN&#xff0c;ACK、SYN&#xff0c;ACK3.以get&#xff0c;post方式发送HTTP请求&…

前端学习(1684):前端系列实战课程之判断游戏结束

<!DOCTYPE html> <html lang"en"><head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"><title>游戏初始化界面</title><style>body {ma…

swift 用协议实现代理传值功能

1.功能简介RootViewController中用个lable和一个按钮&#xff0c;点击按钮跳转到模态窗口。在模态窗口中有个TextField和一个按钮&#xff0c;输入文字点击关闭模态按钮后跳转到RootViewController&#xff0c;并改变其label为输入的值。2 .实现思路ModelViewController中定义一…

前端学习(1685):前端系列实战课程之设置难度

<!DOCTYPE html> <html lang"en"><head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"><title>游戏初始化界面</title><style>body {ma…

git 学习

参考 http://git.oschina.net/oschina/git-osc/wikis/%E5%B8%AE%E5%8A%A9#继续阅读 http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000 常用git 命令 git initgit add <file>git commit -am "XXXX"git remote add origin g…

Linux如何通过命令查看日志文件的某几行(中间几行或最后几行)

linux 如何显示一个文件的某几行(中间几行) 【一】从第3000行开始&#xff0c;显示1000行。即显示3000~3999行 cat filename | tail -n 3000 | head -n 1000 【二】显示1000行到3000行 cat filename| head -n 3000 | tail -n 1000 *注意两种方法的顺序 分解&#xff1a; tail -…

Linux日志高频使用命令

1、cat&#xff1a; 功能&#xff1a;1&#xff09;显示整个文件 $ cat fileName 2&#xff09;把文件串连接后传到基本输出&#xff0c;如将几个文件合并为一个文件或输出到屏幕。 $ cat file1 file2 > file 2、more&#xff1a;以百分比的形式查看日志。 3、less&am…

技能UP:SAP OBYC自动记账的实例说明(含value String应用说明)

一. 自动过账原理 在MM模块的许多操作都能实现在FI模块自动过账&#xff0c;如PO收货、发票验证(LIV)、工单发料、向生产车间发料等等。不用说&#xff0c;一定需要在IMG中进行配置才可以实现自动处理。但SAP实现的这种自动配置的机制是怎样的呢&#xff1f;其实也并不复杂&…

Java多线程系列--“JUC锁”05之 非公平锁

转载自&#xff1a;http://www.cnblogs.com/skywang12345/p/3496651.html点击打开链接 概要 前面两章分析了"公平锁的获取和释放机制"&#xff0c;这一章开始对“非公平锁”的获取锁/释放锁的过程进行分析。内容包括&#xff1a; 参考代码 获取非公平锁(基于JDK1.7.0…