Linux Network Tuning LinuxÍøÂç»·¾³ÐÔÄÜÓÅ»¯µ÷Õû
Linux Network Tuning LinuxÍøÂç»·¾³ÐÔÄÜÓÅ»¯µ÷Õû
À´Ô´£ºcnbird2008µÄרÀ¸ ×÷Õߣº ·¢²¼Ê±¼ä£º2009-06-20 ±êÇ©£ºlinux linuxÐÔÄÜÓÅ»¯ linuxÅäÖÃ
(ÒÔǰдµÄ,µ±Ê±ÓõÄRH Linux AS5.)
ÈçÏÂÍøÂçÅäÖòÎÊýµ÷Õû,Ö÷ÒªÊÇÕë¶ÔÇëÇóѹÁ¦´óµÄLinux (2.6 kernel)·þÎñÆ÷¶øÑÔ.
Èç¹û·þÎñÆ÷ѹÁ¦²»´ó,ÄÇôά³ÖĬÈϼ´¿É.
ÏÂÊöÄÚÈÝÈ¡²ÄÓÚ"Performance Tuning For Linux Server"Ò»Êé.
$ /proc/sys/net/core/wmem_max
×î´ósocketдbuffer,¿É²Î¿¼µÄÓÅ»¯Öµ:873200
$ /proc/sys/net/core/rmem_max
×î´ósocket¶Ábuffer,¿É²Î¿¼µÄÓÅ»¯Öµ:873200
$ /proc/sys/net/ipv4/tcp_wmem
TCPдbuffer,¿É²Î¿¼µÄÓÅ»¯Öµ: 8192 436600 873200
$ /proc/sys/net/ipv4/tcp_rmem
TCP¶Ábuffer,¿É²Î¿¼µÄÓÅ»¯Öµ: 32768 436600 873200
$ /proc/sys/net/ipv4/tcp_mem
ͬÑùÓÐ3¸öÖµ,Òâ˼ÊÇ:
net.ipv4.tcp_mem[0]:µÍÓÚ´ËÖµ,TCPûÓÐÄÚ´æѹÁ¦.
net.ipv4.tcp_mem[1]:ÔÚ´ËÖµÏÂ,½øÈëÄÚ´æѹÁ¦½×¶Î.
net.ipv4.tcp_mem[2]:¸ßÓÚ´ËÖµ,TCP¾Ü¾ø·ÖÅäsocket.
ÉÏÊöÄڴ浥λÊÇÒ³,¶ø²»ÊÇ×Ö½Ú.
¿É²Î¿¼µÄÓÅ»¯ÖµÊÇ:786432 1048576 1572864
$ /proc/sys/net/core/netdev_max_backlog
½øÈë°üµÄ×î´óÉ豸¶ÓÁÐ.ĬÈÏÊÇ300,¶ÔÖظºÔØ·þÎñÆ÷¶øÑÔ,¸Ãֵ̫µÍ,¿Éµ÷Õûµ½1000.
$ /proc/sys/net/core/somaxconn
listen()µÄĬÈϲÎÊý,¹ÒÆðÇëÇóµÄ×î´óÊýÁ¿.ĬÈÏÊÇ128.¶Ô·±Ã¦µÄ·þÎñÆ÷,Ôö¼Ó¸ÃÖµÓÐÖúÓÚÍøÂçÐÔÄÜ.
¿Éµ÷Õûµ½256.
$ /proc/sys/net/core/optmem_max
socket bufferµÄ×î´ó³õʼ»¯Öµ,ĬÈÏ10K.
$ /proc/sys/net/ipv4/tcp_max_syn_backlog
½øÈëSYN°üµÄ×î´óÇëÇó¶ÓÁÐ.ĬÈÏ1024.¶ÔÖظºÔØ·þÎñÆ÷,Ôö¼Ó¸ÃÖµÏÔÈ»Óкô¦.
¿Éµ÷Õûµ½2048.
$ /proc/sys/net/ipv4/tcp_retries2
TCPʧ°ÜÖØ´«´ÎÊý,ĬÈÏÖµ15,Òâζ×ÅÖØ´«15´Î²Å³¹µ×·ÅÆú.¿É¼õÉÙµ½5,ÒÔ¾¡ÔçÊÍ·ÅÄÚºË×ÊÔ´.
$ /proc/sys/net/ipv4/tcp_keepalive_time
$ /proc/sys/net/ipv4/tcp_keepalive_intvl
$ /proc/sys/net/ipv4/tcp_keepalive_probes
Õâ3¸ö²ÎÊýÓëTCP KeepAliveÓйØ.ĬÈÏÖµÊÇ:
tcp_keepalive_time = 7200 seconds (2 hours)
tcp_keepalive_probes = 9
tcp_keepalive_intvl = 75 seconds
Òâ˼ÊÇÈç¹ûij¸öTCPÁ¬½ÓÔÚidle 2¸öСʱºó,Äں˲ŷ¢Æðprobe.
Èç¹ûprobe 9´Î(ÿ´Î75Ãë)²»³É¹¦,Äں˲ų¹µ×·ÅÆú,ÈÏΪ¸ÃÁ¬½ÓÒÑʧЧ.
¶
Ïà¹ØÎĵµ£º
Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖÐÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀÐÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......
Linux ÖÐÈçºÎ²éѯºÍжÔØÒÑ°²×°µÄÈí¼þ
¡¡¡¡LinuxÈí¼þµÄ°²×°ºÍжÔØÒ»Ö±ÊÇÀ§ÈÅÐí¶àÐÂÓû§µÄÄÑÌâ¡£ÔÚWindowsÖУ¬ÎÒÃÇ¿ÉÒÔʹÓÃÈí¼þ×Ô´øµÄ°²×°Ð¶ÔسÌÐò»òÔÚ¿ØÖÆÃæ°åÖеēÌí¼Ó/ɾ³ý³ÌÐò” À´ÊµÏÖ¡£ÓëÆäÏàÀàËÆ£¬ÔÚLinuxÏÂÓÐÒ»¸ö¹¦ÄÜÇ¿´óµÄÈí¼þ°²×°Ð¶Ôع¤¾ß£¬ÃûΪRPM¡£Ëü¿ÉÒÔÓÃÀ´½¨Á¢¡¢°²×°¡¢²éѯ¡¢¸üС¢Ð¶ÔØÈí¼þ¡£¸Ã¹¤ ......
ÍøÉϽéÉÜlinux²Ã¼ôµÄÎÄÕºܶ࣬²»¹ýºÜ¶à¶¼ÊǺöÂÔÁËÇ°ÃæµÄºÜ¶à²½Öè¡£×î½üÀÏ°åÒª²¼ÖÃlinux²Ã¼ôµÄÈÎÎñ£¬ÎÒûÓÐʲôlinuxÏîÄ¿»ù´¡£¬ËùÒԺܶණÎ÷¶¼Òª×Ô¼ºÃþË÷¡£ÏÂÃæÊÇÎÒ×ܽáµÄ²½Öè¡£
LinuxÄں˲üô
1.
Ê×ÏÈ°ÑlinuxÔ´´úÂëÏÂÔص½±¾µØ£¬ÏÂÔصÄÍøÖ·ÊÇwww.kernel.org,
2.&n ......
»ùÓÚLinuxµÄSocketÍøÂç±à³ÌµÄÐÔÄÜÓÅ»¯
2009-10-23 ǶÈëʽÔÚÏß ÊÕ²Ø | ´òÓ¡
1 ÒýÑÔ
Ëæ×ÅIntenetµÄÈÕÒæ·¢Õ¹ºÍÆÕ¼°£¬ÍøÂçÔÚǶÈëʽϵͳÖÐÓ¦Ó÷dz£¹ã·º£¬Ô½À´Ô½¶àµÄǶÈëʽÉ豸²ÉÓÃLinux²Ù×÷ϵͳ¡£LinuxÊÇÒ»¸öÔ´´úÂ빫¿ªµÄÃâ·Ñ²Ù×÷ϵͳ£¬¾ßÓÐÇ¿ÒÆÖ²ÐÔ£¬ ......