[ale] SOLVED: Re: "Too many open files" while opening a socket on Ubuntu
JK
jknapka at kneuro.net
Thu Mar 5 11:44:15 EST 2009
Jim Kinney wrote:
> On Thu, Mar 5, 2009 at 10:07 AM, JK <jknapka at kneuro.net> wrote:
> Maybe a better solution would be to rethink the connection process
> itself. Maybe a multi-threaded listener that can differentiate between
> different connecting hosts/entities and only open 1 socket.
That would be possible, and I've actually tried something similar,
but it doesn't work very well at all. I need to exchange UDP messages
with a great many remote processes (thousands) every second in a
request/reply manner; with only one socket it becomes difficult to
make the timing work out nicely, and kernel buffer sizes become an issue.
(If you're thinking "large-scale SNMP monitoring of real-time processes",
you're on the right track, and no, I don't think SNMP was the right
choice for this application (it was a VERY VERY BAD choice), but
unfortunately I didn't get to choose.)
I have optimized the living poo out of this code, and got it so I
can achieve the required throughput even on XP -- and I expected to
be able to handle higher loads on Linux.
I just tried setting all ulimits to "infinity"... no *&^%^%$# joy :-(((
Screw it, I'm gonna install Fedora.
Oh wait...
Your "sysctl -a" advice made it a LOT easier to see the whole limit
picture, and grepping that output for the magic value 128 led me to
/proc/sys/fs/epoll/max_user_instances, which hmm, looks like it might
have something to do with select/poll...
AND THAT WAS IT!
THANK YOU E+06 !!!!!
If I ever get down Atlanta way again, I owe you alcohol.
-- JK
--
I do not particularly want to go where the money is -
it usually does not smell nice there. -- A. Stepanov
More information about the Ale
mailing list