On Sun, Feb 10, 2013 at 8:29 PM, <[email protected]>wrote:
> Hi! > > On 13:10 Sat 09 Feb , horseriver wrote: > > hi:) > > > > In one process ,what is the max number of opening file descriptor ? > > Type "ulimit -a" in your shell. On my system (debian) the default is 1024. > Hi Michael, nice to see u again. BTW, many of the parameters as reported by ulimit, also has to be taken with some doubts: ulimit -a core file size (blocks, -c) unlimited data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 47543 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 47543 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited the above is for Ubuntu 12.04 with 32-bit kernel (3.2.0) but of course we know that max file size has a limit - depending on whether it is ext2 or ext3 or ext4. cannot remember the exact nos, but general conceptual level, there is a limit. even for "CPU time"...it is limited by the underlying bit length of representation for time. as usual...i don't know the details :-(, just concept. sorry :-(. > > > Can it be set to infinite ? > > Maybe, but at least it can be set very high. > > > In network programing ,what is the essential for the maximum of > connections > > dealed per second > > - Use non blocking i/o and epoll(). Do *not* create 1 process/thread for > each > connection and do not use use select(). > - Obviously, the more memory your application uses, the more memory has to > be > put in the server. IIRC, 1 tcp connection uses ~1kb kernel memory. > - The same applies for cpu time. On the system side, you may want to > recommend > network adaptors which can be switched to polling instead of raising 1 > interrupt per packet. You should expect to see lots of small packets on > the > network. > > -Michi > -- > programing a layer 3+4 network protocol for mesh networks > see http://michaelblizek.twilightparadox.com > > _______________________________________________ > Kernelnewbies mailing list > [email protected] > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > -- Regards, Peter Teoh
_______________________________________________ Kernelnewbies mailing list [email protected] http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
