vinnitu
vinnitu

Reputation: 4364

erlang: gen_tcp:accept limitation

I am interesting what are the limits for gen_tcp:accept function? I mean what is max concurrent connection count? Or how can it be configured? (gen_tcp setting, ulimit or something else) how much get_tcp can accept connection per second?

Upvotes: 2

Views: 1049

Answers (1)

Geoff Reedy
Geoff Reedy

Reputation: 36011

The maximum concurrent connections is going to depend on the operating system. On unix systems it would be limited by the nfds ulimit as well has the maximum number of connections the kernel is configured to handle.

The number of connections accepted per second is mostly going to be dependent on your application code. It must service the requests in a timely manner. The maximum number of pending connection requests is specified by the backlog option to the listen function. Most systems restrict the maximum backlog size, on linux and freebsd this option is named somaxconn. There's also the matter of half-completed TCP handshakes. You'll want to learn about syncookies and any options for tuning the maximum number of half-established connections.

Upvotes: 5

Related Questions