Linux

一段時間後返回結果時出現遠端 jmeter-server 錯誤

  • April 29, 2014

我有一個問題,我正在使用我的電腦上的 jmeter,它驅動安裝在 RHEL5.8 上的 jmeter-server

我的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: Version 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-server 似乎無法再聯繫到我了。問題是在那之前我收到了很多結果,所以網路配置沒有問題。測試正在停止,因為我要求它在出現任何錯誤後停止,但如果我不選中此選項,它會繼續,向日誌文件添加更多錯誤。我在考慮可能在 /etc/security/limits.conf 中進行一些更改,但我不確定。我真的很感激任何想法。

如果您需要更多詳細資訊,請詢問。

我從這個網站得到了幫助:http: //howtojboss.com/2012/07/31/concurrent-high-throughput-performance-testing-with-jmeter/

解決方案是使用此參數,似乎當您打開太多連接時,用於舊連接的埠在 TIME_WAIT 狀態下停留時間過長,因此這有助於:

echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle

引用自:https://serverfault.com/questions/590787