I have a problem, i use boost::asio for my server listener implementation, but using boost::asio when count connected sockets > 1000-1100 i have an error – “Too many opened files”
How can i fix that?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This isn’t a boost::asio problem. This is an OS-level problem. Try doing
ulimit -aon the command line and you’ll see there’s a limit for ‘open files’. This is the number of file descriptors a process is allowed to own. It can be changed, but it’s the reason you’re getting the error.This stack overflow question “How do I change the number of open files limit in Linux?” talks about how this limit can be changed. The short answer is that it’s not particularly simple to do. It’s an OS-level configuration parameter.