ÔõÑùÓÅ»¯LinuxÐÒéÕ»ÌáÉýÍøÂçÐÔÄÜ
ÓÅ»¯LinuxÐÒéÕ»ÊÇÌáÉýÍøÂçÐÔÄܵÄÖ÷Òª°ì·¨£¬ÌØÊâÊÇÔÚ´¦Öóͷ£´ó×ÚÊý¾Ý´«ÊäºÍ¸ß²¢·¢ÇéÐÎϸüÏÔÖ÷Òª¡£±¾ÆªÎÄÕ½«ÏêϸÏÈÈÝÔõÑùͨ¹ýµ÷½âLinuxÐÒéÕ»µÄ²ÎÊýºÍÉèÖÃÀ´ÌáÉýÍøÂçÐÔÄÜ£¬²¢ÌṩÏêϸµÄ´úÂëʾÀý¹©¶ÁÕ߲ο¼¡£
Ò»¡¢µ÷½âTCP²ÎÊý
µ÷½âTCP»º³åÇø¾Þϸ
TCP»º³åÇø¾Þϸֱ½ÓÓ°ÏìÍøÂç´«ÊäÐÔÄÜ£¬¿ÉÒÔͨ¹ýÐÞ¸ÄÒÔϲÎÊýÀ´µ÷½â£º
sudo sysctl -w net.core.rmem_default=1048576 sudo sysctl -w net.core.wmem_default=1048576 sudo sysctl -w net.core.rmem_max=16777216 sudo sysctl -w net.core.wmem_max=16777216
µÇ¼ºó¸´ÖÆ
ÕâЩ²ÎÊý»®·ÖÌåÏÖTCPÎüÊÕ»º³åÇøºÍ·¢ËÍ»º³åÇøµÄĬÈϺÍ×î´ó¾Þϸ£¬Æ¾Ö¤ÏÖʵÍøÂçÇéÐκÍÐèÇóµ÷½â²ÎÊýÖµ£¬¿ÉÒÔÏÔÖø¸ÄÉÆÍøÂçÐÔÄÜ¡£
ÆôÓÃTCP¿ìËÙ·¿ª
TCP¿ìËÙ·¿ª¿ÉÒÔïÔÌÅþÁ¬½¨ÉèµÄʱÑÓ£¬Ìá¸ßÍøÂçÐÔÄÜ£¬¿ÉÒÔͨ¹ýÒÔÏÂÏÂÁîÆôÓãº
sudo sysctl -w net.ipv4.tcp_fastopen=3
µÇ¼ºó¸´ÖÆ
µ÷½âTCPÓµÈû¿ØÖÆËã·¨
Ñ¡ÔñºÏÊʵÄTCPÓµÈû¿ØÖÆËã·¨Ò²¿ÉÒÔÌáÉýÐÔÄÜ£¬¿ÉÒÔͨ¹ýÐÞ¸ÄÒÔϲÎÊýÀ´µ÷½â£º
sudo sysctl -w net.ipv4.tcp_congestion_control=cubic
µÇ¼ºó¸´ÖÆ
¶þ¡¢ÓÅ»¯ÍøÂç½Ó¿Ú
Ó²¼þжÔØ
Ó²¼þжÔØ¿ÉÒÔ½«ÍøÂçÐÒéÕ»µÄ²¿·ÖÊÂÇéתÒƵ½Íø¿¨µÄÓ²¼þÖÐÖ´ÐУ¬¼õÇáCPU¼ç¸º£¬Ìá¸ßÊý¾Ý´«ÊäЧÂÊ¡£¿ÉÒÔͨ¹ýÒÔÏÂÏÂÁîÉó²éϵͳ֧³ÖµÄÓ²¼þжÔع¦Ð§£º
ethtool -k <interface>
µÇ¼ºó¸´ÖÆ
ÈôÊÇÍø¿¨Ö§³ÖÓ²¼þжÔع¦Ð§£¬¿ÉÒÔͨ¹ýÏà¹ØÏÂÁîÉèÖá£
¶àÐÐÁÐÖ§³Ö
¶àÐÐÁÐÖ§³Ö¿ÉÒÔʹÓöà¸ö½¹µã´¦Öóͷ£ÍøÂçÁ÷Á¿£¬Ìá¸ß²¢·¢´¦Öóͷ£ÄÜÁ¦¡£¿ÉÒÔͨ¹ýÒÔÏÂÏÂÁÍøÂç½Ó¿ÚÉèÖÃΪ¶àÐÐÁÐģʽ£º
sudo ethtool -L <interface> combined <num_queues>
µÇ¼ºó¸´ÖÆ
Èý¡¢µ÷½âÄں˲ÎÊý
µ÷½âÄÚºËÖÐÖ¹²ÎÊý
ÄÚºËÖÐÖ¹µÄÓÅ»¯¹ØÓÚÍøÂçÐÔÄÜÖÁ¹ØÖ÷Òª£¬¿ÉÒÔͨ¹ýÒÔÏÂÏÂÁîÀ´µ÷½âÄÚºËÖÐÖ¹²ÎÊý£º
sudo sysctl -w net.core.netdev_max_backlog=30000 sudo sysctl -w net.core.dev_weight=64 sudo sysctl -w net.core.message_cost=5
µÇ¼ºó¸´ÖÆ
½ûÓò»ÐëÒªµÄÄÚºËÄ£¿é
½ûÓò»ÐëÒªµÄÄÚºËÄ£¿é¿ÉÒÔïÔÌϵͳµÄ¼ç¸º£¬Ìá¸ßÐÔÄÜ¡£¿ÉÒÔͨ¹ý±à¼/etc/modprobe.d/blacklist.confÎļþ£¬½«²»ÐèÒªµÄÄÚºËÄ£¿éÌí¼Óµ½ºÚÃûµ¥ÖС£
ͨ¹ýÒÔÉÏÓÅ»¯²½·¥£¬ÎÒÃÇ¿ÉÒÔÏÔÖøÌáÉýLinuxϵͳµÄÍøÂçÐÔÄÜ£¬ÊµÏÖ¸ü¸ßЧµÄÊý¾Ý´«ÊäºÍ´¦Öóͷ£¡£¶ÁÕß¿ÉÒÔƾ֤ÏÖʵÐèÇóºÍÇéÐΣ¬ÍŽáÏêϸÇéÐε÷½â²ÎÊýºÍÉèÖã¬ÒÔʵÏÖ×î¼ÑµÄÐÔÄÜÌåÏÖ¡£
ÒÔÉϾÍÊÇÔõÑùÓÅ»¯LinuxÐÒéÕ»ÌáÉýÍøÂçÐÔÄܵÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡