Jemter学习:jmeter图形端与服务端安装
Jmeter 图形端安装
前置条件
操作系统:不限,一般是 win 系统居多
JDK:1.8+,下载后解压至某一文件夹
参数修改
1. 在 bin 目录下面增加 setenv.bat 文件
rem This is the content of bin\setenv.bat,
rem it will be called by bin\jmeter.bat
set JVM_ARGS=-Xms2g -Xmx2g -Dpropname=longge
这里根据自行调整内存大小,默认为 1024m,做大型测试时起步 4G
其它参考选项,详见官网(1.4 Running JMeter)
https://jmeter.apache.org/usermanual/get-started.html#running
2. 修改 jmeter.properties 配置文件
server.rmi.ssl.disable=true
sampleresult.default.encoding=UTF-8
3. 启动/检测
1. 运行 jmeter.bat 或者 jmeterw.cmd 启动
1. 启动后,采用如下命令,检测进程详细,如下表示进程存在且参数配置生效
wmic process where caption="java.exe" get processid,caption,commandline /value
wmic process where caption="javaw.exe" get processid,caption,commandline /value
Jmeter 服务端安装
前置条件
操作系统:不限,一般为 Linux 系统居多
JDK:1.8+,下载后解压至某一文件夹
参数修改
1. 在 bin 目录下面增加 setenv.sh 文件
#This is the content of bin\setenv.sh,
#it will be called by bin\jmeter.sh
export JVM_ARGS="-Xms2g -Xmx2g -Dpropname=longge"
这里根据自行调整内存大小,默认为 1024m,做大型测试时起步 4G
其它参考选项,详见官网(1.4 Running JMeter)
https://jmeter.apache.org/usermanual/get-started.html#running
2. 修改 jmeter.properties 配置文件
server.rmi.ssl.disable=true
sampleresult.default.encoding=UTF-8
3. 修改 jmeter-server 文件
RMI_HOST_DEF=-Djava.rmi.server.hostname=192.168.128.166
这里根据主机地址修改
4. 启动&检测
1. 运行 sh jmeter-server 启动(常用后台启动,退出终端不会影响程序的运行:nohup ./jmeter-server & )

2. 启动后,采用如下命令 tail -f nohup.out ,检查是否有报错:

3. 检测进程详细,如下表示进程存在且参数配置生效\
ps -ef|grep jmeter

当后台启动Jmeter 错误时可使用如下命令将所有Jmeter进程杀死,重新启动:、
ps -ef|grep jmeter|grep -v grep|cut -c 9-15|xargs kill -9