Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - unable to create more than 995 sockets filedescriptors: (5 Items)
   
unable to create more than 995 sockets filedescriptors  
hi

my program creates a number of active sockets transmitting data to a server at periodic intervals. I get the error 

socket error : Too many open files // errno 24 EMFILE
( this happens at the 996th socket call )

when i try to create about a 1000 connections at the client side.
well i did check out the the ulimit which was set to 1000.
so i increased it up to 2000 using the ulimit -n 2000 command.

apart form that i also used the call setrlimit(RLIMIT_NOFILE, &curr_limits) where curr_limits contains  2000 for both 
soft n hard limit.
the next call getrlimit returns 2000 for both.

but still in the next run i get the same error at the 996th socket call again.

i tried the getconf _SC_OPEN_MAX  it still showed 1000 as the o/p despite the ulimit showing 2000 as the limit.

any of u guys have a  idea as to what may be wrong or how to increase the fd limit.

regards,
Rosen.



 


Re: unable to create more than 995 sockets filedescriptors  
On Wed, Oct 15, 2008 at 08:19:47AM -0400, Rosen Rosen wrote:
> hi
> 
> my program creates a number of active sockets transmitting data to a server at periodic intervals. I get the error 
> 
> socket error : Too many open files // errno 24 EMFILE
> ( this happens at the 996th socket call )
> 
> when i try to create about a 1000 connections at the client side.
> well i did check out the the ulimit which was set to 1000.
> so i increased it up to 2000 using the ulimit -n 2000 command.
> 
> apart form that i also used the call setrlimit(RLIMIT_NOFILE, &curr_limits) where curr_limits contains  2000 for both soft n hard limit.
> the next call getrlimit returns 2000 for both.
> 
> but still in the next run i get the same error at the 996th socket call again.
> 
> i tried the getconf _SC_OPEN_MAX  it still showed 1000 as the o/p despite the ulimit showing 2000 as the limit.
> 
> any of u guys have a  idea as to what may be wrong or how to increase the fd limit.
> 
> regards,
> Rosen.

Try the -F option to procnto.

-seanb
Re: unable to create more than 995 sockets filedescriptors  
Hi Sean,

i did try that out .. 
i did  not find that utility so i proceeded to the  /proc/boot directory.

there was jus one executable procnto-instr

# procnto-instr -F 2000
sh: procnto-instr: Invalid argument

this is what i get .. 
in case u wanna know abt the kernel ver n stuff here is the o/p for uname -a

 # uname -a
QNX EA2c74b9 6.3.2 2006/03/16-14:19:50EST x86pc x86
Re: unable to create more than 995 sockets filedescriptors  
On Wed, Oct 15, 2008 at 08:46:52AM -0400, Rosen Rosen wrote:
> Hi Sean,
> 
> i did try that out .. 
> i did  not find that utility so i proceeded to the  /proc/boot directory.
> 
> there was jus one executable procnto-instr
> 
> # procnto-instr -F 2000
> sh: procnto-instr: Invalid argument
> 
> this is what i get .. 
> in case u wanna know abt the kernel ver n stuff here is the o/p for uname -a
> 
>  # uname -a
> QNX EA2c74b9 6.3.2 2006/03/16-14:19:50EST x86pc x86

You need to rebuild you image.  See the following in the
helpviewer:
  QNX Neutrino RTOS
    Building Embedded Systems
      Making an OS Image

# cd /boot/build
# vi qnxbasedma.build
  < add -F 2000>
# cp /.boot /.altboot
# mkifs -v qnxbasedma.build /.boot

-seanb
Re: unable to create more than 995 sockets filedescriptors  
oh cool rebuild the stuff ( last time i crashed the system doing that LOL :)

thanks a lot Sean.