We are getting too many open files issue on our AWS cloud application when using lambda with spring boot. io.netty.channel.ChannelException:io.netty.channel.unix.Errors$NativeException:newSocketStream(...) failed too many open files.

Spring boot version is 2.6.6 and reactor netty core/http version used is 1.0.17

Can anyone please advise on same.

Comment From: JanStureNielsen

This is likely an OS configuration issue rather than a bug in Spring Boot. Search for "too many open files" for your OS to find solutions.

Comment From: SahilWkar

We are running this service in cloud on lambda. Also i see similar issue raised earlier #21923 and #1792 in past. https://github.com/spring-cloud/spring-cloud-gateway/issues/1792 https://github.com/spring-projects/spring-boot/issues/21923 Is there any changes we need to do w.r.t using netty reactor library version which might help.

Comment From: mhalbritter

Hey, Spring Boot 2.6.6 is no longer in OSS support. Please upgrade to at least Spring Boot 2.7 and feel free to chime back in if the problem persists.

Comment From: SahilWkar

We did upgrade the library to 2.7 ,problem still persists. Can you please help.

Comment From: mhalbritter

If you'd like us to spend some time investigating, please take the time to provide a complete minimal sample (something that we can unzip or git clone, build, and deploy) that reproduces the problem.

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

Comment From: CCx3x

I meet the same question with springboot 2.5.12 and reactor-netty 1.0.17 and netty 4.1.75.Final, what can I do to fix it or find the cause. this is my stack message: io.netty.channel.unix.Errors$NativeIoException: newSocketStream(..) failed: Too many open files; nested exception is io.netty.channel.ChannelException: io.netty.channel.unix.Errors$NativeIoException: newSocketStream(..) failed: Too many open files org.springframework.web.reactive.function.client.WebClientRequestException: io.netty.channel.unix.Errors$NativeIoException: newSocketStream(..) failed: Too many open files; nested exception is io.netty.channel.ChannelException: io.netty.channel.unix.Errors$NativeIoException: newSocketStream(..) failed: Too many open files at org.springframework.web.reactive.function.client.ExchangeFunctions$DefaultExchangeFunction.lambda$wrapException$9(ExchangeFunctions.java:141)

Comment From: mhalbritter

Spring Boot 2.5.12 is out of support. Please upgrade to a supported version of Spring Boot and chime in if the problem still persists. A sample with which we can reproduce the issue would be great.

Comment From: CCx3x

Can I use 2.7.2 or 2.7.18?I can't reoroduce the issue now, it's not frequent, still need to obverse, is there any idea to do?

Comment From: mhalbritter

No, 2.7.x is out of OSS support, too. Only 3.1.x and 3.2.x are supported. 2.7.x - 3.2.x has commercial support available, if you'd like.

I think this is an OS configuration issue, like @JanStureNielsen said.

Comment From: CCx3x

All right. But I find the unlimit config is 655350, it has problem on two of 11 machines. I'm confused too...