From mboxrd@z Thu Jan 1 00:00:00 1970 From: michi1@michaelblizek.twilightparadox.com (michi1 at michaelblizek.twilightparadox.com) Date: Sun, 10 Feb 2013 13:29:32 +0100 Subject: MAX limit of file descriptor In-Reply-To: <20130209051047.GA2806@debian.localdomain> References: <20130209051047.GA2806@debian.localdomain> Message-ID: <20130210122931.GA2269@grml> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org 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