Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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


Ïà¹ØÎĵµ£º

linuxÏ php img ͼƬÎÞ·¨ÏÔʾ

 ½«php·þÎñÆ÷¼Üµ½linuxÏÂʱûÓÐ×¢Òâ¸ÃÎÊÌ⣬
Ç°¼¸Ììµ¹ÊÇÅöµ½ÁËÔÚlinuxÏÂÑéÖ¤ÂëµÄͼƬÎÞ·¨ÏÔʾµÄÇé¿ö£¬·¢ÏÖlinuxÏÂÒ²ÒªÓÐgd¿âµÄÖ§³Ö£¬ÓÚÊÇ°²×°ÁËphp5-gd£¨±¾ÈËʹÓõÄÊÇphp5£©
£¬Õâ¸öÎÊÌâ½â¾öÁË
½ñÌìͻȻ·¢ÏÖimgͼƬÎÞ·¨ÏÔʾ£¬ÉÏÍøËÑÁËÒ»°Ñ£¬ÓÖ¾­¹ý²âÊԵóöÈçϽáÂÛ
<img src="pc.jpg"......>
Ëû»áÒÔµ±Ç°Â·¾¶ ......

Linux·þÎñcannot change directory´íÎó½â¾ö·½·¨

Linux·þÎñcannot change directory´íÎó½â¾ö·½·¨
ÔÚ°²×°Íêvsftp·þÎñºóµÇ½ʱ¿ÉÄÜÓöµ½cannot change directoryºóÃæÊǵǽÕßµÄĿ¼µÄ´íÎó¡£ÕâÊÇÒòΪSEÉèÖõĹرÕÁËftpµÄÔ­Òò¡£
ʹÓÃÃüÁî
getsebool ftpd_disable_trans
¿ÉÒԲ鿴µ±Ç°µÄ״̬Èç¹û²»ÊÇon
ÄÇôÊÇÊäÈëÃüÁî
setsebool ftpd_disable_trans 1
µ±È»Ò²¿ÉÒÔ¼ÓÈë-P² ......

ǶÈëʽ linux Ï ͨÓà console£¨¿ØÖÆ̨£© µÄʵÏÖ

Ç°ÑÔ£º
        µ±ÎÒÃÇʹÓÃǶÈëʽlinux ½øÐпª·¢Ê±£¬kernel ÅÜÆðÀ´Ö®ºó£¬ÎÒÃÇÏ£ÍûÄÜͨ¹ý´®¿Ú£¨±ê×¼ÊäÈë¡¢Êä³ö£©£¬ÔÚÓ¦ÓóÌÐòÕýÔÚÔËÐеĹý³ÌÖУ¬½øÐÐһЩµ÷ÊÔ¹¤×÷£¬ÀýÈ磬¶ÔCPUһЩ¼Ä´æ½øÐе÷Õû£¬ÒÔ¹Û²âµ÷ÕûÒÔºóµÄ½á¹û£¬²¢ÇÒ£¬µ±ÎÒÃÇÎÞ·¨°ÑÎÒÃǵÄÓ¦ÓóÌÐò·ÅÔÚºǫ́ÔËÐУ¬ÄÇôÎÒÃǾÍÐèÒªÊ ......

linuxÄÚºË(2.6)ÖеÄË«Ñ­»·Á´±ídzÎö

       Linux 2.6ÄÚºËÁ´±íÊý¾Ý½á¹¹µÄʵÏÖ
ÔÚ¼ÆËã»ú¿ÆѧÖУ¬Á´±íÊǷdz£Í¨ÓõÄÊý¾Ý½á¹¹£¬¹á´©ÓÚÕû¸ölinuxµÄÄںˡ£ÔÚlinuxÄÚºËÖУ¬Á´±íͨ³£ÒÔ
Ë«Ñ­»·Á´±íµÄ·½Ê½³öÏÖ¡£ËùÓÐÁ´±íµÄ´úÂëÔÚinclude/linux/list.hÎļþÖС£
¶¨ÒåÈçÏ£º
struct list_head {
struct list_head *next, *prev;
}; ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ