孤狼逐月 2023-12-21 09:40 采纳率: 100%
浏览 74
已结题

并发压测报错Connection timed out: connect

使用jmeter测试并发上传文件

在本地测试,配置到1000线程无任何问题

img

将spring boot 项目部署到服务器后测试,仅仅300线程就有报错,信息如下:

org.apache.http.conn.HttpHostConnectException: Connect to 172.27.2.63:9096 [/172.27.2.63] 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:409)
    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:940)
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:651)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:66)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1311)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1300)
    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(Thread.java:748)
Caused by: java.net.ConnectException: Connection timed out: connect
    at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
    at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:81)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:476)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:218)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:200)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:162)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:394)
    at java.net.Socket.connect(Socket.java:606)
    at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:75)
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
    ... 19 more

服务器配置项

防火墙关闭

 /etc/security/limits.conf下配置了

* soft nofile 65535
* hard nofile 65535
* soft nproc 65535
* hard nproc 65535

启动服务命令
nohup java -Xms576M -Xmx9216M -XX:PermSize=576M -XX:MaxPermSize=9216M  -jar /home/betp/${projectInfo}.jar > /home/betp/betp-plugins-admin.log 2>&1 &

数据库及fdfs线程配置应该无问题,因为在本地测试通过了,所不同的只是jar包所在服务器不同,但是如何配置,我还不太明白,有谁晓得的帮忙看看还要如何配置啊

对了,jmeter的配置基本完全一样,只有ip地址和线程数量进行了修改,其他没变

展开全部

  • 写回答

0条回答 默认 最新

      编辑
      预览

      报告相同问题?

      问题事件

      • 系统已结题 12月28日
      • 创建了问题 12月21日

      悬赏问题

      • ¥15 如何获取APP内弹出的网址链接
      • ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了
      • ¥50 STM32单片机传感器读取错误
      • ¥50 power BI 从Mysql服务器导入数据,但连接进去后显示表无数据
      • ¥15 (关键词-阻抗匹配,HFSS,RFID标签)
      • ¥50 sft下载大文阻塞卡死
      • ¥15 机器人轨迹规划相关问题
      • ¥15 word样式右侧翻页键消失
      • ¥15 springboot+vue 集成keycloak sso到阿里云
      • ¥15 win7系统进入桌面过一秒后突然黑屏
      手机看
      程序员都在用的中文IT技术交流社区

      程序员都在用的中文IT技术交流社区

      专业的中文 IT 技术社区,与千万技术人共成长

      专业的中文 IT 技术社区,与千万技术人共成长

      关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

      关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

      客服 返回
      顶部