gpt4 book ai didi

spring-boot - Spring Boot Admin - 系统错误中打开的文件太多

转载 作者:行者123 更新时间:2023-12-02 17:52:47 24 4
gpt4 key购买 nike

我正在尝试在 ECS Fargate 上运行 spring-boot-admin - 几分钟后,服务器死机,日志中充满了“系统中打开的文件太多”错误。
我正在使用 spring-boot 2.3.1,并尝试过 2.2.3 和 spring-boot-admin 的 2.3.0-SNAPSHOT。该 jar 在安装了 openjdk-11-jdk-headless 的 ubuntu 20.04 基础镜像上运行。 ECS 服务有 2gb RAM 可用,我增加了 nofile 和 nproc 的 Ulimits (100000)

      Ulimits:
- Name: nofile
HardLimit: 1000000
SoftLimit: 1000000
- Name: nproc
HardLimit: 1000000
SoftLimit: 1000000
堆栈跟踪: 2020-06-29 22:03:35.691 ERROR 6 --- [io-8080-exec-24] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is io.netty.channel.ChannelException: io.netty.channel.unix.Errors$NativeIoException: newSocketStream(..) failed: Too many open files in system] with root cause io.netty.channel.unix.Errors$NativeIoException: newSocketStream(..) failed: Too many open files in system 2020-06-29 22:03:36.345 ERROR 6 --- [io-8080-exec-14] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is io.netty.channel.ChannelException: io.netty.channel.unix.Errors$NativeIoException: newSocketStream(..) failed: Too many open files in system] with root cause io.netty.channel.unix.Errors$NativeIoException: newSocketStream(..) failed: Too many open files in system 2020-06-29 22:03:36.350 ERROR 6 --- [o-8080-Acceptor] org.apache.tomcat.util.net.Acceptor : Socket accept failed java.io.IOException: Too many open files in system at java.base/sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method) ~[na:na] at java.base/sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:533) ~[na:na] at java.base/sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:285) ~[na:na] at org.apache.tomcat.util.net.NioEndpoint.serverSocketAccept(NioEndpoint.java:469) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36] at org.apache.tomcat.util.net.NioEndpoint.serverSocketAccept(NioEndpoint.java:71) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36] at org.apache.tomcat.util.net.Acceptor.run(Acceptor.java:95) ~[tomcat-embed-core-9.0.36.jar!/:9.0.36] at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]我有一组 8 个微服务与 sba 客户端(目前没有安全性)连接,用于 3 个环境(总共 24 个实例)。只有客户端中的设置是:
spring.boot.admin.client.instance.prefer-ip=true
spring.boot.admin.client.url=https://xxxxx.com
spring.boot.admin.client.instance.name=
spring.boot.admin.client.instance.metadata.tags.environment=${spring.profiles.active}
我启用了首选 IP,因为这些实例中的大多数不在 Eureka 或负载均衡器之后,并且只是处理队列外的数据。
服务器只有 spring.boot.admin.ui.public-url放。
前几分钟一切正常 - 但随后这些错误开始发生并且一切都失败了。 Cloudwatch 指标显示 cpu 达到 100%,然后 sba 上的目标组健康检查失败,ECS 重新启动任务。这目前需要大约 30 分钟。
从默认值提高 ulimits 增加了应用程序崩溃之前的时间,但它最终仍会崩溃 - 就好像它的套接字/连接泄漏一样。
我没有任何运行 webflux/netty 应用程序的经验 - 有什么我遗漏的吗?我需要设置更高的 ulimit 吗?

最佳答案

我遇到了同样的问题,发现在 spring boot 中记录了一个关于此的问题:Many File Open Issue : Spring Boot 2.3.0 -> Spring Boot 2.3.1 #21934
在新版本发布之前,将 reactor-netty 撞到 0.9.9.RELEASE 应该可以修复它,为我做的!

关于spring-boot - Spring Boot Admin - 系统错误中打开的文件太多,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62655110/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com