SpringBoot各类数量限制及超出后抛出的异常

news/2024/10/6 16:07:43/

前言

在使用SpringBoot开发接口时,动不动的就发生各种超过默认值的限制,这里总结了下SpringBoot默认限制的设置以及可能会发生的异常,便于问题的排查和快速修改默认值。

配置项配置项说明默认值超过大小后抛出的异常
spring.servlet.multipart.max-file-sizeMax file size
单个上传文件大小
1MBorg.springframework.web.multipart
 MaxUploadSizeExceededException
org.apache.tomcat.util.http.fileupload.impl
 FileSizeLimitExceededException
spring.servlet.multipart.max-request-sizeMax request size.
总上传文件大小
10MBorg.springframework.web.multipart
 MaxUploadSizeExceededException
org.apache.tomcat.util.http.fileupload.impl
 SizeLimitExceededException
server.max-http-header-sizeMaximum size of the HTTP message header8KB此值设置过大可能会造成内存溢出
server.tomcat.max-http-form-post-sizeMaximum size of the form content in any HTTP post request2MB
server.tomcat.accept-countMaximum queue length for incoming connection requests when all possible request processing threads are in use
当所有可能的请求处理线程都在使用中时,传入连接请求的最大队列长度
100
server.tomcat.max-connectionsMaximum number of connections that the server accepts and processes at any given time. Once the limit has been reached, the operating system may still accept connections based on the “acceptCount” property
服务器在任何给定时间接受和处理的最大连接数。一旦达到限制,操作系统仍然可以接受基于“acceptCount”属性的连接
8192
server.tomcat.threads.min-spareMinimum amount of worker threads
工作线程的最小数量,初始化时创建的线程数
10
server.tomcat.threads.maxMaximum amount of worker threads
工作线程的最大数量
200
server.tomcat.connection-timeoutAmount of time the connector will wait, after accepting a connection, for the request URI line to be presented
连接器在接受连接后等待显示请求 URI 行的时间
20000
server.tomcat.keep-alive-timeoutTime to wait for another HTTP request before the connection is closed. When not set the connectionTimeout is used. When set to -1 there will be no timeout
在关闭连接之前等待另一个 HTTP 请求的时间。如果未设置,则使用 connectionTimeout。设置为 -1 时不会超时
20000
server.tomcat.max-keep-alive-requestsMaximum number of HTTP requests that can be pipelined before the connection is closed. When set to 0 or 1, keep-alive and pipelining are disabled. When set to -1, an unlimited number of pipelined or keep-alive requests are allowed
在连接关闭之前可以进行流水线处理的最大HTTP请求数量。当设置为0或1时,禁用keep-alive和流水线处理。当设置为-1时,允许无限数量的流水线处理或keep-alive请求
100
server.tomcat.max-swallow-sizeMaximum amount of request body to swallow2MB
spring.datasource.hikari.maximum-pool-sizehikari线程池最大数量

http://www.ppmy.cn/news/1473991.html

相关文章

Spring Boot中的数据校验

Spring Boot中的数据校验 大家好,我是免费搭建查券返利机器人省钱赚佣金就用微赚淘客系统3.0的小编,也是冬天不穿秋裤,天冷也要风度的程序猿!今天我们将深入探讨Spring Boot中的数据校验,了解如何在应用程序中有效地验…

rabbitmq+nginx负载服务部署文档

前言 rabbitmq普通集群部署后,存在服务单点承压的情况,故,需要通过前端负载解决单点承压的问题;将采用nginx作为负载器,对流量进行负载分发到各个集群节点,解决服务单点负载的问题环境 虚拟机4台,如下列表…

【C++】stack和queue的模拟实现 双端队列deque的介绍

🔥个人主页: Forcible Bug Maker 🔥专栏: STL || C 目录 🌈前言🔥stack的模拟实现🔥queue的模拟实现🔥deque(双端队列)deque的缺陷 🌈为什么选择…

uniapp/Android App上架三星市场需要下载所需要的SDK

只需添加以下一个权限在AndroidManifest.xml <uses-permission android:name"com.samsung.android.providers.context.permission.WRITE_USE_APP_FEATURE_SURVEY"/>uniapp开发的&#xff0c;需要在App权限配置中加入以上的额外权限&#xff1a;

PyQT: 开发一款ROI绘制小程序

在一些基于图像或者视频流的应用中&#xff0c;比如电子围栏/客流统计等&#xff0c;我们需要手动绘制一些感兴趣&#xff08;Region of Interest&#xff0c;简称ROI&#xff09;区域。 在这里&#xff0c;我们基于Python和PyQt5框架开发了一款桌面应用程序&#xff0c;允许用…

k8s record 20240705

k8s 安全管理 request 是1g&#xff0c;你得不到要求&#xff0c;我就不创建了&#xff0c;这就是准入控制二次校验 SA就是serviceAccount。 内部是SA和 token, 外部用户进来就是 .kube/config文件 namespace下的是role&#xff0c;整个集群是 ClusterRole. 动作就是Binding li…

【Oracle】Oracle常用语句大全

目录 创建/删除数据库创建/删除表其他表操作增加字段修改字段重命名字段删除字段 主键/索引/视图相关数据插入数据更新数据删除字段拼接merge into语法案例素材同时更新和插入记录同步错误 分页查询分组查询/筛选排序连接查询1. 内连接&#xff08;INNER JOIN&#xff09;&…

工厂自动化相关设备工业一体机起到什么作用?

在当今的制造业领域&#xff0c;工厂自动化已成为提高生产效率、保证产品质量和降低成本的关键。在这一进程中&#xff0c;工业一体机作为一种重要的设备&#xff0c;发挥着不可或缺的作用。 工业一体机是自动化生产线上的控制中心。它能够整合和处理来自各个传感器、执行器和其…