栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

SpringBoot项目后台接口设置超时时间并发数

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

SpringBoot项目后台接口设置超时时间并发数

1 前期调研

大部分文章都提到以下两个配置spring.mvc.async.request-timeout和server.tomcat.connection-timeout,实测不能达到效果。

考虑spring/tomcat本身是否有相关配置,翻阅了官方文档和源码,理解如下:

    对于同步接口,暂时没有(没找到)超时时间配置。
    对于异步接口,有超时时间配置(具体往下看spring.mvc.async.request-timeout)。

下方列了两个大部分文章都提到的配置项描述、使用方式,以及其他超时时间配置方法:
 

server.tomcat.connection-timeout

    Amount of time the connector will wait, after accepting a connection, for the request URI line to be presented.

server.tomcat.connection-timeout是建立连接需要的时间,非连接处理的时间
 

spring.mvc.async.request-timeout

 Amount of time before asynchronous request handling times out. If this value is not set, the default timeout of the underlying implementation is used.

spring.mvc.async.request-timeout 异步请求的时间,搭配Callable使用

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/870432.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号