Your program should call setrlimit on startup to change the number of file descriptors. See http://unix.stackexchange.com/a/29579.
On Tue, Jan 24, 2017 at 5:14 PM, Brad House via c-ares <c-ares@cool.haxx.se> wrote: > 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 epoll()/kqueue() > instead of select, we load test regularly with high connection counts, > can't say we've seen an issue. > > -Brad > > > On 1/24/17 6:18 PM, David Guillen Fandos wrote: > >> 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 tweaking the constant). >> >> Is there any other way or suggestion? I thought of initializing c-ares at >> the startup phase so I always get smallish fds >> but it is a bit dodgy :D My program uses many many sockets >> >> Thanks! >> >> David >> >>