我有一个问题,我在我的电脑上使用 jmeter,它驱动安装在 RHEL5.8 上的 jmeter 服务器
我的 Java 版本是:
[jmeter@sem-osb logs]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.8 (Tikanga)
[jmeter@sem-osb logs]$ java -version
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
我的电脑运行的是 ArchLinux。在两台电脑上我都使用相同版本的 Jmeter,即:jmeter.JMeter:版本 2.11 r1554548
因此,我尝试运行一个简单的测试,向 soap webservice 发出 3 个请求,并尝试模拟 2 个永远运行这些请求的客户端(我想加载服务器)。
一段时间后,我在 jmeter-server.log 上收到以下错误:
2014/04/23 14:57:39 INFO - jmeter.util.JMeterUtils: Setting Locale to fr_FR
2014/04/23 14:57:39 INFO - jmeter.util.JMeterUtils: Could not find resources for 'fr_FR', using 'fr'
2014/04/23 14:57:39 INFO - jmeter.JMeter: Loading user properties from: /appli/jmeter/jmeter/bin/user.properties
2014/04/23 14:57:39 INFO - jmeter.JMeter: Loading system properties from: /appli/jmeter/jmeter/bin/system.properties
2014/04/23 14:57:39 INFO - jmeter.JMeter: Setting System property: java.rmi.server.hostname=172.30.96.210
2014/04/23 14:57:39 INFO - jmeter.JMeter: Setting System property: server_port=1099
2014/04/23 14:57:39 INFO - jmeter.JMeter: Copyright (c) 1998-2014 The Apache Software Foundation
2014/04/23 14:57:39 INFO - jmeter.JMeter: Version 2.11 r1554548
2014/04/23 14:57:39 INFO - jmeter.JMeter: java.version=1.7.0_51
2014/04/23 14:57:39 INFO - jmeter.JMeter: java.vm.name=Java HotSpot(TM) 64-Bit Server VM
2014/04/23 14:57:39 INFO - jmeter.JMeter: os.name=Linux
2014/04/23 14:57:39 INFO - jmeter.JMeter: os.arch=amd64
2014/04/23 14:57:39 INFO - jmeter.JMeter: os.version=2.6.18-308.11.1.el5
2014/04/23 14:57:39 INFO - jmeter.JMeter: file.encoding=UTF-8
2014/04/23 14:57:39 INFO - jmeter.JMeter: Default Locale=français (France)
2014/04/23 14:57:39 INFO - jmeter.JMeter: JMeter Locale=français (France)
2014/04/23 14:57:39 INFO - jmeter.JMeter: JMeterHome=/appli/jmeter/jmeter
2014/04/23 14:57:39 INFO - jmeter.JMeter: user.dir =/appli/jmeter/jmeter
2014/04/23 14:57:39 INFO - jmeter.JMeter: PWD =/appli/jmeter/jmeter
2014/04/23 14:57:39 INFO - jmeter.JMeter: IP: 172.30.96.210 Name: **** FullName: ****
2014/04/23 14:57:40 INFO - jmeter.engine.RemoteJMeterEngineImpl: Starting backing engine on 1099
2014/04/23 14:57:40 INFO - jmeter.engine.RemoteJMeterEngineImpl: Local IP address=172.30.96.210
2014/04/23 14:57:40 INFO - jmeter.engine.RemoteJMeterEngineImpl: IP address is a site-local address; this may cause problems with remote access.
Can be overridden by defining the system property 'java.rmi.server.hostname' - see jmeter-server script file
2014/04/23 14:57:40 INFO - jmeter.engine.RemoteJMeterEngineImpl: Creating RMI registry (server.rmi.create=true)
2014/04/23 14:57:40 INFO - jmeter.engine.RemoteJMeterEngineImpl: Bound to registry on port 1099
2014/04/23 14:58:00 WARN - jmeter.engine.RemoteJMeterEngineImpl: Backing engine is null, ignoring reset
2014/04/23 14:58:00 INFO - jmeter.samplers.SampleEvent: List of sample_variables: []
2014/04/23 14:58:00 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Cannot find .className property for htmlParser, using default
2014/04/23 14:58:00 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/html is
2014/04/23 14:58:00 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xhtml+xml is
2014/04/23 14:58:00 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xml is
2014/04/23 14:58:00 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/xml is
2014/04/23 14:58:00 INFO - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/vnd.wap.wml is org.apache.jmeter.protocol.http.parser.RegexpHTMLParser
2014/04/23 14:58:00 INFO - jmeter.samplers.BatchSampleSender: Using batching for this run. Thresholds: num=100, time=60000
2014/04/23 14:58:00 INFO - jmeter.samplers.DataStrippingSampleSender: Using DataStrippingSampleSender for this run
2014/04/23 14:58:00 INFO - jmeter.engine.RemoteJMeterEngineImpl: Creating JMeter engine on host 172.30.96.210 base '.'
2014/04/23 14:58:00 INFO - jmeter.engine.RemoteJMeterEngineImpl: Remote client host: 172.30.102.135
2014/04/23 14:58:00 INFO - jmeter.engine.StandardJMeterEngine: Listeners will be started after enabling running version
2014/04/23 14:58:00 INFO - jmeter.engine.StandardJMeterEngine: To revert to the earlier behaviour, define jmeterengine.startlistenerslater=false
2014/04/23 14:58:00 INFO - jmeter.services.FileServer: Default base='/appli/jmeter/jmeter'
2014/04/23 14:58:00 INFO - jmeter.services.FileServer: Set new base='.'
2014/04/23 14:58:00 INFO - jmeter.engine.StandardJMeterEngine: Applying properties {}
2014/04/23 14:58:00 INFO - jmeter.engine.RemoteJMeterEngineImpl: Running test
2014/04/23 14:58:00 INFO - jmeter.engine.StandardJMeterEngine: Running the test!
2014/04/23 14:58:00 INFO - jmeter.samplers.SampleEvent: List of sample_variables: []
2014/04/23 14:58:00 INFO - jmeter.engine.util.CompoundVariable: Note: Function class names must contain the string: '.functions.'
2014/04/23 14:58:00 INFO - jmeter.engine.util.CompoundVariable: Note: Function class names must not contain the string: '.gui.'
2014/04/23 14:58:00 INFO - jmeter.engine.StandardJMeterEngine: Starting ThreadGroup: 1 : Groupe d'unités
2014/04/23 14:58:00 INFO - jmeter.engine.StandardJMeterEngine: Starting 2 threads for group Groupe d'unités.
2014/04/23 14:58:00 INFO - jmeter.engine.StandardJMeterEngine: Test will stop on error
2014/04/23 14:58:00 INFO - jmeter.threads.ThreadGroup: Starting thread group number 1 threads 2 ramp-up 60 perThread 30000.0 delayedStart=false
2014/04/23 14:58:00 INFO - jmeter.threads.JMeterThread: jmeterthread.startearlier=true (see jmeter.properties)
2014/04/23 14:58:00 INFO - jmeter.threads.JMeterThread: Running PostProcessors in forward order
2014/04/23 14:58:00 INFO - jmeter.protocol.http.sampler.HTTPHCAbstractImpl: Local host = ****
2014/04/23 14:58:00 INFO - jmeter.protocol.http.sampler.HTTPHC3Impl: HTTP request retry count = 0
2014/04/23 14:58:00 INFO - jmeter.threads.ThreadGroup: Started thread group number 1
2014/04/23 14:58:00 INFO - jmeter.engine.StandardJMeterEngine: All thread groups have been started
2014/04/23 14:58:00 INFO - jmeter.threads.JMeterThread: Thread started: Groupe d'unités 1-1
2014/04/23 14:58:00 INFO - jmeter.samplers.SampleResult: Note: Sample TimeStamps are START times
2014/04/23 14:58:00 INFO - jmeter.samplers.SampleResult: sampleresult.default.encoding is set to ISO-8859-1
2014/04/23 14:58:00 INFO - jmeter.samplers.SampleResult: sampleresult.useNanoTime=true
2014/04/23 14:58:00 INFO - jmeter.samplers.SampleResult: sampleresult.nanoThreadSleep=5000
2014/04/23 14:58:30 INFO - jmeter.threads.JMeterThread: Thread started: Groupe d'unités 1-2
2014/04/23 14:59:21 INFO - jmeter.threads.JMeterThread: Stop Test detected by thread: Groupe d'unités 1-2
2014/04/23 14:59:21 INFO - jmeter.threads.JMeterThread: Thread finished: Groupe d'unités 1-2
2014/04/23 14:59:21 INFO - jmeter.threads.JMeterThread: Stopping: Groupe d'unités 1-2
2014/04/23 14:59:21 INFO - jmeter.threads.JMeterThread: Stopping: Groupe d'unités 1-1
2014/04/23 14:59:21 ERROR - jmeter.threads.RemoteThreadsListenerWrapper: java.rmi.ConnectIOException: Exception creating connection to: 172.30.102.135; nested exception is:
java.net.NoRouteToHostException: Ne peut attribuer l'adresse demandée
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at org.apache.jmeter.threads.RemoteThreadsListenerImpl_Stub.threadFinished(Unknown Source)
at org.apache.jmeter.threads.RemoteThreadsListenerWrapper.threadFinished(RemoteThreadsListenerWrapper.java:61)
at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:599)
at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:961)
at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:946)
at org.apache.jmeter.threads.JMeterThread.threadFinished(JMeterThread.java:571)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:310)
at java.lang.Thread.run(Unknown Source)
Caused by: java.net.NoRouteToHostException: Ne peut attribuer l'adresse demandée
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown Source)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown Source)
... 12 more
2014/04/23 14:59:21 INFO - jmeter.threads.JMeterThread: Thread finished: Groupe d'unités 1-1
2014/04/23 14:59:21 INFO - jmeter.engine.StandardJMeterEngine: Notifying test listeners of end of test
2014/04/23 14:59:21 INFO - jmeter.samplers.DataStrippingSampleSender: Test Ended on 172.30.96.210
2014/04/23 14:59:21 INFO - jmeter.samplers.BatchSampleSender: Test Ended on 172.30.96.210
2014/04/23 14:59:21 INFO - jmeter.engine.StandardJMeterEngine: Test has ended on host 172.30.96.210
错误中提到的 IP 172.30.102.135 是我开始测试的 IP,也就是我的电脑。所以过了一段时间后,jmeter 服务器似乎无法再联系到我了。问题是我在此之前收到了很多结果,所以网络配置没有问题。测试停止是因为我要求它在出现任何错误后停止,但如果我不选中此选项,它就会继续,并在日志文件中添加更多错误。我在想也许可以在 /etc/security/limits.conf 中做些更改,但我不太确定。我真的很感激任何想法。
如果您需要更多详细信息,请询问。
答案1
我从这个网站获得了帮助:http://howtojboss.com/2012/07/31/concurrent-high-throughput-performance-testing-with-jmeter/
解决方案是使用这个参数,似乎当你打开太多连接时,用于旧连接的端口在 TIME_WAIT 状态下停留的时间太长,所以这有帮助:
echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle