Jmeter测试Asp.net应用程序获取超时

guz6ccqo  于 2022-11-09  发布在  .NET
关注(0)|答案(1)|浏览(230)

问题:

  • 我asp.net在我的服务器(使用IIS)中测试我的www.example.com webapi应用程序,并发数设置为2000,循环计数是永久的,改变几秒后,我得到Connection timed out: connect错误

我所尝试的:
1.在jmeter GUI中设置http连接超时和响应超时为200000ms。
1.在IIS管理器中将requestQueueLimit设置为65535,将最小进程数设置为15。
1.在web.config文件中将minWorkerThread和minIoThread设置为200,并将超时设置为20分钟,然后在IIS中重新启动我应用程序
以上都不起作用,我发现服务器的cpu使用率一直很低,下面是使用jmeter测试时的屏幕截图:
cpu usage
jmeter screen shot
以下是错误日志:

org.apache.http.conn.HttpHostConnectException: Connect to XXX.XXX.com:80 [XXX.XXXX.com/XXXX] failed: Connection timed out: connect
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:156)
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl$JMeterDefaultHttpClientConnectionOperator.connect(HTTPHC4Impl.java:408)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376)
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:939)
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:650)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:66)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1301)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1290)
    at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:651)
    at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:570)
    at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:501)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:268)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.net.ConnectException: Connection timed out: connect
    at java.net.DualStackPlainSocketImpl.connect0(Native Method)
fzsnzjdm

fzsnzjdm1#

1.在您的网站配置中选中Maximum Concurrent Connectionsother limits:高级设置-〉限制-〉最大并发连接数
1.它可能根本没有与IIS连接,并且由于数据库配置不正确或使用了inefficient algorithms,可能会在您的网站级别发生超时。请考虑使用YourKitdotTrace等分析工具遥测重新运行您的测试-它将为您提供有关引擎盖下发生的情况的完整信息
1.不要使用JMeter GUI运行负载测试,它只用于测试开发和调试,当涉及到执行时,您应该running your JMeter tests in command-line non-GUI mode
1.删除所有监听器,它们不会增加任何价值,只会消耗宝贵的资源

相关问题