MAX limit of file descriptor
michi1 at michaelblizek.twilightparadox.com
michi1 at michaelblizek.twilightparadox.com
Sun Feb 10 07:29:32 EST 2013
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.
> 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
More information about the Kernelnewbies
mailing list