Re: Opening 5000 file descriptors in linux??

Richard B. Johnson (root@chaos.analogic.com)
Tue, 30 Mar 1999 09:50:16 -0500 (EST)


On Tue, 30 Mar 1999, Gerold Jury wrote:

> Mike Shaver wrote:
>
> > 2.2.x with the large-fdset patches can handle > 10^5 descriptors, last I
> > heard from our server guys.
> >
> > Mike
> >
>
> Unfortunately there seems to be another problem somewhere else.
> Maby its a limitation of libc/glibc.
>
> I wrote an application that tries to open as many sockets as possible
> to simulate a big amount of clients to a server.
>

This shows that you can open 1021 sockets on my machine. Since 3
fds are already open, the default limitation seems to be 1024 as
expected.

#include <stdio.h>
#include <sys/socket.h>

main()
{
int s;
for(s = 0;; s++)
if(socket(AF_INET,SOCK_STREAM,0) <0) break;
printf("%d\n", s);
}

Cheers,
Dick Johnson
***** FILE SYSTEM WAS MODIFIED *****
Penguin : Linux version 2.2.4 on an i686 machine (400.59 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/