jmeter壓測配置

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

註冊表須要添加兩個配置,位置:
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ Tcpip \ Parameters併發

 

MaxUserPort :65534app

TcpTimedWaitDelay:30this

 

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

# 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併發跑了很久都沒有出錯㋡
相關文章
相關標籤/搜索