Re: reached select() limit

2017-01-24 Thread Daniel Hardman
Thank you for reminding me about the select() limit's relationship to FD_SET. I had forgotten that. My quick answer about setrlimit() was based on a binary I worked in that used c-ares plus numerous other socket-oriented libraries. I ran into the FD_SET problem in my other socket-dependent

Re: reached select() limit

2017-01-24 Thread Zan Lynx
On January 24, 2017 7:16:35 PM MST, Daniel Hardman wrote: >Your program should call setrlimit on startup to change the number of >file >descriptors. See http://unix.stackexchange.com/a/29579. > > That will not help because select has a hard coded limit of the number

reached select() limit

2017-01-24 Thread David Guillen Fandos
Hello, I wrote an app that was crashing in c-ares due to fds being bigger than 1024. While c-ares might be using around 30 fds it is unable to use fds above 1024. I looked into using getsock but it is capped at 16 sockets (although could be worked around by building c-ares myself and

Re: reached select() limit

2017-01-24 Thread Brad House via c-ares
I'm pretty sure c-ares just uses a single socket per nameserver, so to have more than 16 socks, you'd have to have more than 8 DNS servers (I'm assuming here that each server tries both UDP, then due to response overflow has to retry via TCP). I use c-ares with an event based system where we use

Re: reached select() limit

2017-01-24 Thread Brad House via c-ares
David is correct, on many systems, like Linux, select() cannot handle file descriptor *numbers*, higher than 1023 (most people assume it is just the count of fds set via FD_SET cannot exceed 1024, which is also true). Since he stated he is working with fds higher than that, it is presumed his