<br><br><div class="gmail_quote">On Sun, Feb 10, 2013 at 8:29 PM, <span dir="ltr"><<a href="mailto:michi1@michaelblizek.twilightparadox.com" target="_blank">michi1@michaelblizek.twilightparadox.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi!<br>
<div class="im"><br>
On 13:10 Sat 09 Feb , horseriver wrote:<br>
> hi:)<br>
><br>
> In one process ,what is the max number of opening file descriptor ?<br>
<br>
</div>Type "ulimit -a" in your shell. On my system (debian) the default is 1024.<br></blockquote><div><br></div><div>Hi Michael, nice to see u again. </div><div><br></div><div>BTW, many of the parameters as reported by ulimit, also has to be taken with some doubts:</div>
<div><br></div><div><div>ulimit -a</div><div>core file size (blocks, -c) unlimited</div><div>data seg size (kbytes, -d) unlimited</div><div>scheduling priority (-e) 0</div><div>file size (blocks, -f) unlimited</div>
<div>pending signals (-i) 47543</div><div>max locked memory (kbytes, -l) 64</div><div>max memory size (kbytes, -m) unlimited</div><div>open files (-n) 1024</div><div>pipe size (512 bytes, -p) 8</div>
<div>POSIX message queues (bytes, -q) 819200</div><div>real-time priority (-r) 0</div><div>stack size (kbytes, -s) 8192</div><div>cpu time (seconds, -t) unlimited</div><div>max user processes (-u) 47543</div>
<div>virtual memory (kbytes, -v) unlimited</div><div>file locks (-x) unlimited</div></div><div><br></div><div>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. </div>
<div><br></div><div>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 :-(.</div><div><br></div><div>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
> Can it be set to infinite ?<br>
<br>
</div>Maybe, but at least it can be set very high.<br>
<div class="im"><br>
> In network programing ,what is the essential for the maximum of connections<br>
> dealed per second<br>
<br>
</div>- Use non blocking i/o and epoll(). Do *not* create 1 process/thread for each<br>
connection and do not use use select().<br>
- Obviously, the more memory your application uses, the more memory has to be<br>
put in the server. IIRC, 1 tcp connection uses ~1kb kernel memory.<br>
- The same applies for cpu time. On the system side, you may want to recommend<br>
network adaptors which can be switched to polling instead of raising 1<br>
interrupt per packet. You should expect to see lots of small packets on the<br>
network.<br>
<br>
-Michi<br>
<span class="HOEnZb"><font color="#888888">--<br>
programing a layer 3+4 network protocol for mesh networks<br>
see <a href="http://michaelblizek.twilightparadox.com" target="_blank">http://michaelblizek.twilightparadox.com</a><br>
</font></span><div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Regards,<br>Peter Teoh