Hey, It really depends on couple factors and I am not sure I am following exactly what body are you closing or supposed to close? Also it depends on the client side of the connection and the keep-alive settings of the connection. The other factor is the actual load on the system. If it's a Linux based server you should take a look at the output of ss or netstat to understand if connections are on an ESTABLISHED state more then they are supposed to be or, that connections are on time_wait or another state. If connections are on ESTABLISHED mode then one solution might fit but if it's on time_wait or close_wait it's a whole other story. The basic 1k or 4k FD limit is not a fit for a web server so if you are using one of these upper the limit to 16k first and then see if you are still affected by the issue. ..unless if you have too many connections in ESTABLISHED state and I would encourage you to turn on iptables and use iptstate or conntrack utils to see how many idle connections you are having. I have used iptables connection tracking more then once to find out that indeed closing idle connections which are maintaining the "keep-alive" are the cause for similar issues. Have you tried disabling "keep-alive"??
All The Bests, Eliezer ---- http://ngtech.co.il/lmgtfy/ Linux System Administrator Mobile: +972-5-28704261 Email: elie...@ngtech.co.il From: golang-nuts@googlegroups.com [mailto:golang-nuts@googlegroups.com] On Behalf Of l...@pinkfroot.com Sent: Wednesday, October 18, 2017 14:35 To: golang-nuts <golang-nuts@googlegroups.com> Subject: Re: [go-nuts] accept4: too many open files; In the end the fix seemed to be implementing some timeouts. I found a good guide here... https://blog.cloudflare.com/the-complete-guide-to-golang-net-http-timeouts/ On Tuesday, October 17, 2017 at 10:01:17 PM UTC+1, Tamás Gulácsi wrote: Yes. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to mailto:golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.