Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
* num limit on socket opened using accept() ?
@ 2001-05-31  9:01 jstwo
  2001-05-31  9:20 ` Nithyanandham
  2001-05-31  9:58 ` jstwo
  0 siblings, 2 replies; 6+ messages in thread
From: jstwo @ 2001-05-31  9:01 UTC (permalink / raw)


Hi,

I am working on a network server module. when i test it with massive
simultaneous connections, it stopped accept new connection after getting
240+ connections( the maximum fd num is 255). it will start accept new one
after some old one closed. it's quite odd as the fd limit has been set to
1024/1024 for one process.
I read somewhere that the problem is with the version of libc which limit
the maximum fd to 255. Is it true and how to overcome the problem easily
 without recompile the libc hoefully)?

the system config is :
Redhat 6.2 for alpha. kernel 2.2.14. libc(glibc2) 2.1.3.
BTW, the program is written ontop of  ACE library.

Thanks

jstwo.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: num limit on socket opened using accept() ?
  2001-05-31  9:01 num limit on socket opened using accept() ? jstwo
@ 2001-05-31  9:20 ` Nithyanandham
  2001-05-31  9:35   ` jstwo
  2001-05-31  9:58 ` jstwo
  1 sibling, 1 reply; 6+ messages in thread
From: Nithyanandham @ 2001-05-31  9:20 UTC (permalink / raw)




jstwo wrote:

> Hi,
>
> I am working on a network server module. when i test it with massive
> simultaneous connections, it stopped accept new connection after getting
> 240+ connections( the maximum fd num is 255). it will start accept new one
> after some old one closed. it's quite odd as the fd limit has been set to
> 1024/1024 for one process.
> I read somewhere that the problem is with the version of libc which limit
> the maximum fd to 255. Is it true and how to overcome the problem easily
>  without recompile the libc hoefully)?

Do "ulimit -a " to know the maximum number of fd allowed .
You can change this using setrlimit( ).

Remember that the maximum number of fd per user per process is different from
the
maximum number of fd for the whole system.

--Nithyanand.
  Siemens, Bangalore, India.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: num limit on socket opened using accept() ?
  2001-05-31  9:20 ` Nithyanandham
@ 2001-05-31  9:35   ` jstwo
  2001-05-31  9:55     ` Nithyanandham
  0 siblings, 1 reply; 6+ messages in thread
From: jstwo @ 2001-05-31  9:35 UTC (permalink / raw)


thanks for reply.

the soft limit showed using "ulimit -Sn" is 1024. to be sure , i also set it
in the program to 1024. but it didnt help at all.

jstwo
"Nithyanandham" <m.nithyanandham@blr.spcnl.co.in> wrote in message
news:3B160CE5.8845F2A1@blr.spcnl.co.in...
>
>
> jstwo wrote:
>
> > Hi,
> >
> > I am working on a network server module. when i test it with massive
> > simultaneous connections, it stopped accept new connection after getting
> > 240+ connections( the maximum fd num is 255). it will start accept new
one
> > after some old one closed. it's quite odd as the fd limit has been set
to
> > 1024/1024 for one process.
> > I read somewhere that the problem is with the version of libc which
limit
> > the maximum fd to 255. Is it true and how to overcome the problem easily
> >  without recompile the libc hoefully)?
>
> Do "ulimit -a " to know the maximum number of fd allowed .
> You can change this using setrlimit( ).
>
> Remember that the maximum number of fd per user per process is different
from
> the
> maximum number of fd for the whole system.
>
> --Nithyanand.
>   Siemens, Bangalore, India.
>




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: num limit on socket opened using accept() ?
  2001-05-31  9:35   ` jstwo
@ 2001-05-31  9:55     ` Nithyanandham
  0 siblings, 0 replies; 6+ messages in thread
From: Nithyanandham @ 2001-05-31  9:55 UTC (permalink / raw)




jstwo wrote:

> thanks for reply.
>
> the soft limit showed using "ulimit -Sn" is 1024. to be sure , i also set it
> in the program to 1024.

You should be a 'root' to do that.

Nithyanand.
Siemens, Bangalore, India.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: num limit on socket opened using accept() ?
  2001-05-31  9:01 num limit on socket opened using accept() ? jstwo
  2001-05-31  9:20 ` Nithyanandham
@ 2001-05-31  9:58 ` jstwo
  2001-05-31 11:30   ` Nithyanandham
  1 sibling, 1 reply; 6+ messages in thread
From: jstwo @ 2001-05-31  9:58 UTC (permalink / raw)


I just find a define in include/linux/limit.h from the kernel source tree:
#define OPEN_MAX 256 /* # open files a process may have */

could this be the one that cause the problem? if i change this number to
1024 ( and compile a new kernel if needed), will there any other binary be
affected ?

Regards.
jstwo
"jstwo" <jstwo@writeme.NoSpAm.com> wrote in message
news:9f50l7$phe$1@coco.singnet.com.sg...
> Hi,
>
> I am working on a network server module. when i test it with massive
> simultaneous connections, it stopped accept new connection after getting
> 240+ connections( the maximum fd num is 255). it will start accept new one
> after some old one closed. it's quite odd as the fd limit has been set to
> 1024/1024 for one process.
> I read somewhere that the problem is with the version of libc which limit
> the maximum fd to 255. Is it true and how to overcome the problem easily
>  without recompile the libc hoefully)?
>
> the system config is :
> Redhat 6.2 for alpha. kernel 2.2.14. libc(glibc2) 2.1.3.
> BTW, the program is written ontop of  ACE library.
>
> Thanks
>
> jstwo.
>
>




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: num limit on socket opened using accept() ?
  2001-05-31  9:58 ` jstwo
@ 2001-05-31 11:30   ` Nithyanandham
  0 siblings, 0 replies; 6+ messages in thread
From: Nithyanandham @ 2001-05-31 11:30 UTC (permalink / raw)




jstwo wrote:

> I just find a define in include/linux/limit.h from the kernel source tree:
> #define OPEN_MAX 256 /* # open files a process may have */

sysconf(_SC_OPEN_MAX );
getrlimit(RLIMIT_NOFILE, &limits);(limits has soft & hard limits)
ulimit(UL_GDESLIM, 0);
getdtablesize( )
are the other options.

> could this be the one that cause the problem?

Yes.  !

> if i change this number to
> 1024 ( and compile a new kernel if needed),

If you want to set it for an individual process, do it using setrlimit( ) or
ulimit(should be a root).
or
if you want to set it statically , you need to recompile the kernel .

--Nithyanand.
  Siemens, Bangalore, India.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-05-31 11:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-05-31  9:01 num limit on socket opened using accept() ? jstwo
2001-05-31  9:20 ` Nithyanandham
2001-05-31  9:35   ` jstwo
2001-05-31  9:55     ` Nithyanandham
2001-05-31  9:58 ` jstwo
2001-05-31 11:30   ` Nithyanandham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox