Link to home
Start Free TrialLog in
Avatar of checkin
checkin

asked on

Accept Error : Too many open files

Hi !

Running Solaris on a Sun Ultra we are getting an error from accept() stating that there are too many files open.
How can we avoid this, we have tried setting the number of file descriptors by using ulimit -n from 64 to 128, but this makes no difference.
Avatar of Triskelion
Triskelion
Flag of United States of America image

How many files do you have open at a time?
Can you close unused files?

Avatar of checkin
checkin

ASKER

the application is a server which accepts connections to clients, a single client can open 30 connections which last for about 3 seconds before they are closed.
At the momment we can not get over 2 clients connecting simulateously without getting the error from accept of too many files open.  We are connecting using Unix Domain Sockets.
Where is your accept()?  Are you forking for each call?  Have you tried making multiple processes that run fulltime,
one for each line in (or however many you want to handle at once), and using pipes to them for handling the transactions?  I guess the last question is really trying to find out if your process is complaining about too many open, or the OS is complaining.  If the latter, is there an OS install parameter you have set too small?  A sample of your handler which opens 30 redone to execute by itself, and hold them open until killed, could be run as many times as you need simultaneously to give you more info and tell you when you have the problem solved.
ASKER CERTIFIED SOLUTION
Avatar of FKern
FKern

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial