linuxÏÂfile descriptoerÏÞÖÆ
linuxÏÂfile descriptoerÏÞÖÆ
ĬÈÏ·ÖÀà 2009-11-21 14:47 ÔĶÁ0 ÆÀÂÛ0
×ֺţº ´ó´ó ÖÐÖРСС
Tuning file descriptor limits on Linux
Linux limits the number of file descriptors that any one process may open; the default limits are 1024 per process. These limits can prevent optimum performance of both benchmarking clients (such as httperf and apachebench) and of the web servers themselves (Apache is not affected, since it uses a process per connection, but single process web servers such as Zeus use a file descriptor per connection, and so can easily fall foul of the default limit).
The open file limit is one of the limits that can be tuned with the ulimit command. The command
ulimit -aS
displays the current limit, and
ulimit -aH
displays the hard limit (above which the limit cannot be increased without tuning kernel parameters in /proc).
The following is an example of the output of
ulimit -aH
. You can see that the current shell (and its children) is restricted to 1024 open file descriptors.
core file size (blocks) unlimiteddata seg size (kbytes) unlimitedfile size (blocks) unlimitedmax locked memory (kbytes) unlimitedmax memory size (kbytes) unlimitedopen files 1024pipe size (512 bytes) 8stack size (kbytes) unlimitedcpu time (seconds) unlimitedmax user processes 4094virtual memory (kbytes) unlimited
Increasing the file descriptor limit
The file descriptor limit can be increased using the following procedure:
Edit
/etc/security/limits.conf
and add the lines:
* soft nofile 1024
* hard nofile 65535
Edit
/etc/pam.d/login
, adding the line:
session required /lib/security/pam_limits.so
The system file descriptor limit is set in
/proc/sys/fs/file-max
. The following command will increase the limit to 65535:
echo 65535 > /proc/sys/fs/file-max
You should then be able to increase the file descriptor limits using:
ulimit -n unlimitedThe above
Ïà¹ØÎĵµ£º
ÀýÒ»£º·¢ËÍSignaling Packet£º
Signaling CommandÊÇ2¸öBluetoothʵÌåÖ®¼äµÄL2CAP²ãÃüÁî´«Êä¡£ËùÒÔµÃSignaling CommandʹÓÃCID 0x0001.
¶à¸öCommand¿ÉÒÔÔÚÒ»¸öC-frame£¨control frame£©Öз¢ËÍ¡£
Èç¹ûÒªÖ±½Ó·¢ËÍSignaling Command.ÐèÒª½¨Á¢SOCK_RAWÀàÐ͵ÄL2CAPÁ¬½ÓSocket¡£ÕâÑù²ÅÓлú»á×Ô¼ºÌî³äCommand Code£¬Identi ......
yumÊÇʲô?(linuxÃüÁî)
Ò». yumÊÇʲô
yum = Yellow dog Updater, Modified
Ö÷Òª¹¦ÄÜÊǸü·½±ãµÄÌí¼Ó/ɾ³ý/¸üÐÂRPM°ü.
ËüÄÜ×Ô¶¯½â¾ö°üµÄÒÐÀµÐÔÎÊÌâ.
ËüÄܱãÓÚ¹ÜÀí´óÁ¿ÏµÍ³µÄ¸üÐÂÎÊÌâ
×¢:ΪʲôҪʹÓÃyum¶ø²»ÓÃapt,×î¼òµ¥µÄÔÒò,Fedora×Ô´ø
¶þ. yumÌصã
*¿ÉÒÔͬʱÅäÖöà¸ö×ÊÔ´¿â(Repository)
*¼ò½àµÄÅäÖÃÎļ ......
ÔÎÄÁ´½Ó£ºhttp://www.trucy.org/blog/archives/eoiae/000087.html
GDBÊÇÒ»¸öÇ¿´óµÄÃüÁîÐе÷ÊÔ¹¤¾ß¡£´ó¼ÒÖªµÀÃüÁîÐеÄÇ¿´ó¾ÍÊÇÔÚÓÚ£¬Æä¿ÉÒÔÐγÉÖ´ÐÐÐòÁУ¬Ðγɽű¾¡£UNIXϵÄÈí¼þÈ«ÊÇÃüÁîÐеģ¬Õâ¸ø³ÌÐò¿ª·¢Ìá´ú¹©Á˼«´óµÄ±ãÀû£¬ÃüÁîÐÐÈí¼þµÄÓÅÊÆÔÚÓÚ£¬ËüÃÇ¿ÉÒԷdz£ÈÝÒ׵ļ¯³ÉÔÚÒ» ......
×÷Õߣºbioforge alkerr@yifan.net
ÔÃû£º <<Hacking the Linux Kernel Network Stack>>
·Ò룬Ð޸ģº duanjigang <duanjigang1983@126.com>
·Òë²Î¿¼£ºraodan (raod_at_30san.com) 2003-08-22
µÚÒ»Õ ¼ò½é
±¾ÎĽ«ÃèÊöÈçºÎÀûÓÃLinuxÍøÂç¶ÑÕ»µÄÇÏÃÅ£¨²»Ò»¶¨¶¼ÊÇ©¶´£©À´´ïµ½Ò»Ð©Ä¿µÄ£¬»ò ......
Ò»¡¢ÏÂÔØ
gd-2.0.33.tar.gz http://www.boutell.com/gd/
jpegsrc.v6b.tar.gz http://www.ijg.org/
libpng-1.2.7.tar.tar http://sourceforge.net/projects/libpng/
zlib-1.2.2.tar.gz http://sourceforge.net/projects/zlib/
freetype-2.1.9.tar.gz http://sourceforge.net/projects/freetype/
php-4.3.9.tar.g ......