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

linuxµÄ×î´ó½ø³Ì¾ä±úÊýÉèÖÃ

ÔÚLinuxÏ£¬ÎÒÃÇʹÓÃulimit -nÃüÁî¿ÉÒÔ¿´µ½µ¥¸ö½ø³ÌÄܹ»´ò¿ªµÄ×î´óÎļþ¾ä±úÊýÁ¿(socketÁ¬½ÓÒ²ËãÔÚÀïÃæ)¡£ÏµÍ³Ä¬ÈÏÖµ1024¡£
¶ÔÓÚÒ»°ãµÄÓ¦ÓÃÀ´Ëµ(ÏóApache¡¢ÏµÍ³½ø³Ì)1024ÍêÈ«×㹻ʹÓᣵ«ÊÇÈçºÎÏósquid¡¢mysql¡¢javaµÈµ¥½ø³Ì´¦Àí´óÁ¿ÇëÇóµÄÓ¦ÓÃÀ´Ëµ¾ÍÓеã×½½ó¼ûÖâÁË¡£Èç¹ûµ¥¸ö½ø³Ì´ò¿ªµÄÎļþ¾ä±úÊýÁ¿³¬¹ýÁËϵͳ¶¨ÒåµÄÖµ£¬¾Í»áÌáµ½“too many files open”µÄ´íÎóÌáʾ¡£
ÈçºÎÖªµÀµ±Ç°½ø³Ì´ò¿ªÁ˶àÉÙ¸öÎļþ¾ä±úÄØ£¿ÏÂÃæÒ»¶ÎС½Å±¾¿ÉÒÔ°ïÄã²é¿´£º
lsof -n |awk '{print $2}'|sort|uniq -c |sort -nr|more¡¡¡¡
ÔÚϵͳ·ÃÎʸ߷åʱ¼äÒÔrootÓû§Ö´ÐÐÉÏÃæµÄ½Å±¾£¬¿ÉÄܳöÏֵĽá¹ûÈçÏ£º
# lsof -n|awk '{print $2}'|sort|uniq -c |sort -nr|more¡¡¡¡¡¡¡¡131 24204¡¡¡¡ 57 24244¡¡¡¡ 57 24231¡¡¡¡ 56 24264
ÆäÖеÚÒ»ÐÐÊÇ´ò¿ªµÄÎļþ¾ä±úÊýÁ¿£¬µÚ¶þÐÐÊǽø³ÌºÅ¡£µÃµ½½ø³ÌºÅºó£¬ÎÒÃÇ¿ÉÒÔͨ¹ýpsÃüÁîµÃµ½½ø³ÌµÄÏêϸÄÚÈÝ¡£
ps -aef|grep 24204 mysql¡¡¡¡24204 24162 99 16:15 ?¡¡¡¡¡¡¡¡00:24:25 /usr/sbin/mysqld
Ŷ£¬Ô­À´ÊÇmysql½ø³Ì´ò¿ª×î¶àÎļþ¾ä±úÊýÁ¿¡£µ«ÊÇËûÄ¿Ç°Ö»´ò¿ªÁË131¸öÎļþ¾ä±úÊýÁ¿£¬Ô¶Ô¶µ×ÓÚϵͳĬÈÏÖµ1024¡£
µ«ÊÇÈç¹ûϵͳ²¢·¢Ìرð´ó£¬ÓÈÆäÊÇsquid·þÎñÆ÷£¬ºÜÓпÉÄܻᳬ¹ý1024¡£Õâʱºò¾Í±ØÐëÒªµ÷Õûϵͳ²ÎÊý£¬ÒÔÊÊÓ¦Ó¦Óñ仯¡£
LinuxÓÐÓ²ÐÔÏÞÖƺÍÈíÐÔÏÞÖÆ¡£¿ÉÒÔͨ¹ýulimitÀ´É趨ÕâÁ½¸ö²ÎÊý¡£
·½·¨ÈçÏ£¬ÒÔrootÓû§ÔËÐÐÒÔÏÂÃüÁ
ulimit -HSn 4096
ÒÔÉÏÃüÁîÖУ¬HÖ¸¶¨ÁËÓ²ÐÔ´óС£¬SÖ¸¶¨ÁËÈíÐÔ´óС£¬n±íʾÉ趨µ¥¸ö½ø³Ì×î´óµÄ´ò¿ªÎļþ¾ä±úÊýÁ¿¡£
¸öÈ˾õµÃ×îºÃ²»Òª³¬¹ý4096£¬±Ï¾¹´ò¿ªµÄÎļþ¾ä±úÊýÔ½¶àÏìӦʱ¼ä¿Ï¶¨»áÔ½Âý¡£É趨¾ä±úÊýÁ¿ºó£¬ÏµÍ³ÖØÆôºó£¬ÓÖ»á»Ö¸´Ä¬ÈÏÖµ¡£
Èç¹ûÏëÓÀ¾Ã±£´æÏÂÀ´£¬¿ÉÒÔÐÞ¸Ä.bash_profileÎļþ£¬¿ÉÒÔÐÞ¸Ä /etc/profile °ÑÉÏÃæÃüÁî¼Óµ½×îºó¡£
±¾ÎÄÏêÎĵØÖ·£ºhttp://www.bianceng.cn/OS/Linux/200706/3022.htm


Ïà¹ØÎĵµ£º

LinuxÉ豸ģÐÍÖ®input×ÓϵͳÏê½â

Ò»£ºÇ°ÑÔ
×î½üÔÚÑо¿androidµÄsensor driver£¬Ö÷ÒªÊÇE-compass£¬ÆäÖÐÓõ½ÁËLinux input×Óϵͳ.ÔÚÍøÉÏÒ²¿´Á˺ܶàÕâ·½ÃæµÄ×ÊÁÏ£¬¸Ð¾õ»¹ÊÇÕâƪ·ÖÎöµÄ±È½ÏϸÖÂ͸³¹£¬Òò´ËתÔØÒ»ÏÂÒÔ±ã×Ô¼ºÑ§Ï°£¬Í¬Ê±ºÍ´ó¼Ò·ÖÏí£¡
£¨Õâƪ²©¿ÍÖ÷ÒªÊÇÒÔ¼üÅÌÇý¶¯ÎªÀýµÄ£¬²»¹ý½²½âµÄÊÇLinux Input Subsystem£¬¿ÉÒÔ×ÐϸµÄÑо¿Ò»Ï£¡£©
¼üÅÌÇý¶¯½«¼ì ......

linuxѧϰ±Ê¼Ç£¨×ª£©

linuxĿ¼¼Ü¹¹
/   ¸ùĿ¼
/bin    ³£ÓõÄÃüÁî binary file µÄÄ¿錄
/boot   ´æ·ÅϵͳÆô¶¯Ê±±ØÐë¶ÁÈ¡µÄµµ°¸£¬°üÀ¨ºËÐÄ (kernel) ÔÚÄÚ
     /boot/grub/menu.lst   GRUBÉèÖÃ
     /boot/vmlinuz   ÄÚºË
   ......

linuxÈí¼þ°²×°·½Ê½×ܽᣨT£©

  REDHAT Linux 9.0Öм¸ÖÖÈí¼þ°²×°·½Ê½
1.ͨ¹ýRPMÈí¼þ°üÀ´°²×°
˵ÆðRPM£¨REDHAT Package Management£©±ê×¼µÄÈí¼þ°ü£¬´ó¼Ò¿ÉÄܶ¼»áÏëÆð´óÃû¶¦¶¦µÄREDHAT¹«Ë¾£¬ÕýÊÇRPMÈí¼þ°ü·¢Ðз½Ê½µÄ³öÏÖ£¬Ê¹LinuxÖеÄÓ¦ÓÃÈí¼þ°²×°±äµÃ¼òµ¥¡£Èç¹ûÓû§Ïë°²×°°´RPM·½Ê½·¢ÐеÄÈí¼þ£¬Ö»Ðè¼òµ¥µØÊäÈëÃüÁî¡°rpm -ivh xxx.rpm¡±¼ ......

VIM+GDB linux c/c++ µÄ±à³ÌÀûÆ÷

ÆäʵVIMÒ²ÄܰѱàÒë µ÷ÊÔ¼¯³ÉÔÚÒ»Æð£¬ÏñÊÇÒ»¸öIDEÒ»Ñù¡£
Ê×ÏÈÏÖÔÚVIMµÄÔ´Â룬ÒòΪҪ¼¯³Éµ÷ÊÔ»·¾³µÄ»°ÐèÒªÖØбàÒëVIM²ÅÐУ¬ËùÒÔÎÒÃDz»ÈçÖØа²×°Ò»¸ö¡£
VIMµÄÏÖÔÚµØÖ·£º
http://www.vim.org/sources.php
È»ºóÏÂÔØVIMGDB£¬ÕâÊÇvimµÄ¼¯³Éµ÷ÊÔ»·¾³µÄÒ»¸öÖØÒª²å¼þ³ÌÐò¡£
µØÖ·£ºhttp://sourceforge.net/projects/clewn/files ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ