jmeter壓測配置


windows上面修改最大使用端口數和time_await等待時間

注冊表需要添加兩個配置,位置:
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ Tcpip \ Parameters

 

MaxUserPort :65534

TcpTimedWaitDelay:30

 

然而這么配置了之后,壓測一段時間任然會有connect use錯誤提示出現,懷疑是jmeter沒有重用keep alive,官方配置發現有三個配置參數比較可疑:

# Idle connection timeout (Milliseconds) to apply if the server does not send
# Keep-Alive headers (default 0)
# Set this > 0 to compensate for servers that don't send a Keep-Alive header
# If <= 0, idle timeout will only apply if the server sends a Keep-Alive header
httpclient4.idletimeout=10000

# Check connections if the elapsed time (Milliseconds) since the last
# use of the connection exceed this value
httpclient4.validate_after_inactivity=0

# TTL (in Milliseconds) represents an absolute value.
# No matter what, the connection will not be re-used beyond its TTL.
httpclient4.time_to_live=0
 
這么調整了配置之后還是不靠譜,jmeter.properties,user.properties這兩個文件都修改過,任然有錯誤出現。
 
 
最好在官方發現這么一段話:
Use KeepAlive
 
JMeter sets the Connection:  keep-alive header. This does not work properly with the default HTTP implementation, as connection re-use is not under user-control. It does work with the Apache HttpComponents HttpClient implementations.
 
懷疑是jmeter使用的client的問題,把Http Request->Advanced里面的Client Implement選擇為Java之后,問題解決,1000並發跑了好久都沒有出錯㋡
 
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM