Accept Error : Socket Connection


#1

Hi,

I got the following error in production .

http: Accept error: accept tcp [::]:5000: accept4: too many open files; retrying in 10ms

http: Accept error: accept tcp [::]:5000: accept4: too many open files; retrying in 1s
time=“2016-01-31T05:00:55Z” level=error msg=“http: proxy error: dial tcp: lookup www.xxx.com on 172.31.0.2:53: dial udp 172.31.0.2:53: socket: too many open files”

any help, what exactly does open files here mean

does tyk create a new thread for every request

and when does it kill the thread if it gets created


#2

Here’s our guide on configuring for production, specifically resource limits:

https://tyk.io/v1.9/setup/deploy-tyk-to-production/#resource-limits:b763ae43a615716a166812738c388705


#3

Martin,

Could you please elaborate more on this issue? I also have this issue and Tyke Gateway doesn’t accept any connections. I need to understand what causes this exception.

Kind regards,

Tim


#4

The gateway is opening up many file handlers for each proxies connection, at some point the allocation for the OS runs out of handles.

There’s a few ways to handle it:

  1. Increase the number of file handles
  2. Set close_commections to true in your tyk.conf

I’d do both - as recommended in our deploying to production guide.

(Note this advice is for the latest versions - Can’t guarantee 0.9)