30000 open sockets

30000 open sockets

Post by Colin Fran » Sun, 15 Feb 1998 04:00:00

Has anyone been able to configure the kernel to allow a large number of
sockets per proccess?

I am interested in having more than 20,000 open sockets on my linux box.

I did the following and was able to get about 16393 sockets before:
    kernel: VFS: No free inodes - contact Linus

    /* Fixed constants first: */
    #define NR_OPEN 30000
    #define NR_INODE 32768  /* this should be bigger than NR_FILE */
    #define NR_FILE  30000  /* this can well be larger on a larger
system */

    #define NR_OPEN          30000
    #define OPEN_MAX         30000  /* # open files a process may have

    #define __FD_SETSIZE    32768

** Test program.
#include <sys/types.h>
#include <sys/socket.h>
        int i, s;
        for(i=0; i<30000; i++)
                if( (s=socket(AF_INET, SOCK_STREAM, 0)) < 0 )
                        { perror("socket"); break; }
                        printf("%d:     %d\n", i, s);



1. 30000+ Undefined References

I am building a X-Windows application that is dependent on several
objects, half a dozen user libraries, and half a dozen X system
libraries.  I've hacked through all the compiler errors, and now am in
the process of linking, but I'm issued literally over 30K "undefined
references" to functions in the libraries.  Obviously I'm missing
something simple and the linker cannot find the libraries, right?  I
have flags in my makefile for user and system libraries, each of the

usr_lib = -lmylib1 -lmylib2
sys_lib = -lsyslib1 -syslib2 ... (you get the idea)

and macros for the paths to the libraries :
lib_path = -L${PATH_TO_USER} \

The user library path leads to a directory of soft links (I'm using
Linux Kernel 2.2) that each point to the actual library, whereas the X
libraries are physicall in the ${PATH_TO_XLIBS}.  My flags for make are:


flags = -MD -ansi -pedantic -Wall -Wno-unused

debug = -g

Most of which I don't fully understand (I'm working on someone else's
project).  In any case, is there possibly a flag I'm missing?  Or is it
a shell thing? (I use tcsh)  Please just give me an idea what could be
wrong.  Thanks.


2. Mouse movement interferes w/ CDROM

3. Paradise Accel VLB 30000

4. Where to store .class files on a Web server

5. How do I enable TV out port on ATI PC2TV or 3dFX 30000?

6. hacked via nfs?

7. ndd -set /dev/arp arp_cleanup_interval 30000

8. LILO Broke in version 19 !!!????

9. map a process open file to a open socket ?

10. Can't open a broadcast socket because there are too many open files?

11. socket question - which process opened a socket?

12. Opening a socket connection while in a socket connection.

13. Converting 30,000 Macintosh Microsoft Word to a Flat File in UNIX