- Включить jumbo frame linux
- Включить jumbo frame linux
- To Show the Driver Statistics in a Solaris Environment
- To Enable Jumbo Frames in a Solaris Environment Using nxge.conf
- To Check Layer 2 Configuration
- To Check Layer 3 Configuration
- To Enable Jumbo Frames in a Linux Environment
- To Show the Driver Statistics in a Linux Environment
- Linux Configure Jumbo Frames to Boost Network Performance / Throughput
- Configure eth0 interface for Jumbo Frames
- Make changes permanent
- A note about Debian / Ubuntu Linux user:
- Application Protocol Tunning
Включить jumbo frame linux
В этот час мне хотелось бы говорить за создание Jumbo-фреймов в Linux.
Так ,что большие кадры?
Jumbo-фреймы — в Ethernet, упакованные в шесть раз больше, чем обычные 1500 байтов + Ethernet заголовок (9108 байт). Рамки лишь немного больше, чем 1518 байт, как у младенца большие кадры. Если вы оставили эти пакеты эффективность резко возрастает, как заголовок сети Ethernet без изменений, то есть 20-байтовый IP и 20 байт TCP, а при увеличении количества полезной информации. Это также, несомненно, преимущество, ,что оно снижает нагрузку на сервер центрального процессора. Минус больших кадров является техническим ограничением технологии, введенные в целях использования сетевого оборудования, а именно здесь необходимость гигабитных коммутаторов (маршрутизаторов) и Gigabit Ethernet карты (NIC).
Перед настройкой Jumbo кадров настоятельно рекомендуется проверить все совместимость сетевого оборудования, изучить техническую документацию! 10/100 сетей в джамбо технологии кадров не работает!
Итак настроим jumbo frames на ОС CentOS, RHEL, Fedora:
[-hide-]Данная команда единоразово увеличиваем размер кадра, после перезагрузки настройка не сохраняется!
# ifconfig eth1 mtu 5000
Для постоянного применения настроек редактируем конфигурационный файлик:
Путем добавления в него строчки:
Сохраняем файлик и перезапускаем сетевой интерфейс:
# service network restart
Теперь настроим jumbo frames в ОС Debian, Ubuntu путем добавления строчки MTU 5000 в конфигурационный файлик:
После редактирования сохраняем файлик и перезапускаем сетевой интерфейс:
Следующая настройка в ОС FreeBSD:
Для кратковременного использования: (ifconfig
# ifconfig em1 10.20.110.2 mtu 5000
Для использования jumbo frames при маршрутизации (route get
# route get 10.20.110.2
Для постоянного использования jumbo frames редактируем конфигурационный файлик:
И редактируем следующую строчеку:
ifconfig_em1=»inet x.x.x.x netmask y.y.y.y media 1000baseTX mediaopt full-duplex mtu 5000″
Сохраняем файлик и перезапускаем сетевой интерфейс:
Источник
Включить jumbo frame linux
This chapter describes how to configure the Jumbo Frames feature. This chapter contains the following sections:
Configuring Jumbo Frames enables the Ethernet interfaces to send and receive packets larger than the standard 1500 bytes. However, the actual transfer size depends on the switch capability and the device driver capability.
Note — Refer to the documentation that came with your switch for exact commands to configure Jumbo Frames support. |
The Jumbo Frames configuration checking occurs at Layer 2 or Layer 3, depending on the configuration method.
To Show the Driver Statistics in a Solaris Environment
1. Use the kstat command to display driver statistics, for example:
The previous example diplays the receive packet counts on all of the eight receive DMA channels on interface 1. Using the kstat nxge:1 command shows all the statistics that the driver supports for that interface.
2. Use the kstat command to display driver statistics of a VLAN interface.
This section describes how to enable Jumbo Frames in both a SPARC and an x86 environment.
To Enable Jumbo Frames in a Solaris Environment Using nxge.conf
1. Enable Jumbo Frames for a port using the nxge.conf file.
2. Reboot the system:
3. Set the maximum MTU for maximum performance:
To Check Layer 2 Configuration
View the maximum transmission unit (MTU) configuration of an nxge instance at any time with the kstat command:
The kstat mac_mtu variable represents the complete size of the Ethernet frame, which includes the Ethernet header, maximum payload, and crc . The value of this variable should be equal to or less than the MTU configured on the switch.
To Check Layer 3 Configuration
Check the Layer 3 configuration by using the dladm command with the show-link option.
This section describes how to enable Jumbo Frames in a Linux environment.
To Enable Jumbo Frames in a Linux Environment
1. Ensure that the nxge software is installed.
2. Plumb the Sun Dual 10GbE XFP PCIe ExpressModule interface:
where xxx.xxx.xx.xxx is the IP address of the interface.
3. Set the MTU for maximum performance:
where number is the instance number of the interface you want to configure Jumbo Frames on.
To Show the Driver Statistics in a Linux Environment
1. Use the ifconfig utility to display driver statistics.
2. Use the ethtool utility with the -S option to get more detailed information.
This option displays a large amount of statistics maintained by the driver.
3. (Optional) To get more specific statitics, use the grep command on the output of ethtool -S :
Sun Dual 10GbE XFP PCIe ExpressModule User’s Guide | 820-1606-12 |
Copyright © 2008 Sun Microsystems, Inc. All Rights Reserved.
Источник
Linux Configure Jumbo Frames to Boost Network Performance / Throughput
Q. Jumbo frames are Ethernet frames with more than 1500 bytes of payload MTU. Does Linux support jumbo frames? If so how do I set frames to 9000 bytes under Linux operating systems?
A. Most modern Linux distros (read as Linux Kernel 2.6.17+) does support frames larger than 1500 bytes. This can improve the performance. First, make sure your network driver supports custom MTU. Second you need to have a compatible gigabit NIC and switch (such as Cisco Catalyst 4000/4500 Switches with Supervisor III or Supervisor IV ) that is jumbo frame clean. If you are not sure about requirements, please refer to your product documentation.
Jumbo frames can reduce server overhead such as a big decrease in CPU usage when transferring larger file. Also you should see some increase in network throughput.
Configure eth0 interface for Jumbo Frames
Simply type the following command at a shell prompt to set new MTU (Jumbo Frames):
# ifconfig eth0 mtu 9000
Make changes permanent
Edit the network configuration file for eth0 interface – for example, /etc/sysconfig/network-script/ifcfg-eth0 (CentOS / RHEL / Fedora Linux):
# vi /etc/sysconfig/network-script/ifcfg-eth0
Append the following configuration directive, which specifies the size of the frame in bytes:
MTU 9000
- No ads and tracking
- In-depth guides for developers and sysadmins at Opensourceflare✨
- Join my Patreon to support independent content creators and start reading latest guides:
- How to set up Redis sentinel cluster on Ubuntu or Debian Linux
- How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
- How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
- A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
- How to protect Linux against rogue USB devices using USBGuard
Join Patreon ➔
A note about Debian / Ubuntu Linux user:
Debian / Ubuntu Linux user should add MTU=9000 to /etc/network/interfaces configuration file.
Close and save the file. Restart the Interface eth0:
# /etc/init.d/networking restart
To confirm the MTU used between two specific devices. use ip command as follows:
# ip route get
# ip route get 192.168.1.1
Output:
Application Protocol Tunning
You may need to tune the application / network protocol such as NFS and SMB to take advantage of Jumbo Frames.
Updated for accuracy.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via
Category | List of Unix and Linux commands |
---|---|
Documentation | help • mandb • man • pinfo |
Disk space analyzers | df • duf • ncdu • pydf |
File Management | cat • cp • less • mkdir • more • tree |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Linux Desktop Apps | Skype • Spotify • VLC 3 |
Modern utilities | bat • exa |
Network Utilities | NetHogs • dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • glances • gtop • jobs • killall • kill • pidof • pstree • pwdx • time • vtop |
Searching | ag • grep • whereis • which |
Shell builtins | compgen • echo • printf |
Text processing | cut • rev |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
Comments on this entry are closed.
Hi, nice article
just one (1) error; for debian/ubuntu in /etc/network/interfaces, it’s mtu 9000 (mtu(space)9000) *NOT* mtu=9000 (this is only for redhat linuxes)!
THANK YOU!! You saved the whole point of this article, I was looking specifically for jumbo frames for ubuntu
Actually that only works if your statically setting the IP/etc… for that interface. If you’re using dhcp you have to set the MTU after the card is configured otherwise it will be overwritten by whatever the dhcp server passes it. To get around this I setup mine up like this:
auto eth0
iface eth0 inet dhcp
post-up /sbin/ifconfig eth0 mtu 7000
Thanks for the article. I have a second ethernet card that’s a gigabit card and I tried running ifconfig eth1 mtu 9000 and it gives me an error “SIOCSIFMTU: Invalid argument”. Any idea why this is happening? Also, modifying /etc/network/interfaces didn’t seem to help either.
Chris; I just had the same thing happen on Hardy and a quick Google shows that we are not alone. It must be outside the range that our drivers/hw allow for this chipset, just taking a huge swag. I really need this to work too. FWIW:
processor : 0
vendor_id : AuthenticAMD
cpu family : 15
model : 104
model name : AMD Turion(tm) 64 X2 Mobile Technology TL-60
nVidia MCP67 Ethernet
Linux jeff-laptop 2.6.24-19-generic #1 SMP Wed Jun 18 14:43:41 UTC 2008 i686 GNU/Linux
Will get to the bottom of this since I just spent the previous weekend rewiring the house with cat6, upgraded all routers, etc….
Follow-on to my last but just got new information. Chris, open a term and do a ‘sudo ethtool eth0’ or whatever your actual device is. Amongst other useful information there was this (and yes I do have a gigabit ethernet card):
Settings for eth0:
Supported ports: [ MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Advertised auto-negotiation: Yes
Speed: 100Mb/s
Sorry if that came out dodgy but the thing to note is my driver only thinks I can do 100M and as such, I would assume it would be hard for the above command to work. Well, there is a new kernel out too so I might as well grab the drivers and make a party of it…
Thanks for your reply. It’s strange how you have a gigabit card, yet your limit was only 100Mb/s. Perhaps you had another one, eth1? I know mine correctly has a max limit of 1000Mb/s, but somehow I couldn’t get it to work initially. I found out my card (Netgear GA311) had a max MTU of 7500, but setting that didn’t work. When I did a little bit more googling, I found out that someone who had the same card set the MTU to 7200. Once I did that, it worked for me. So I guess your initial theory was right in that the number was out of range of the max MTU.
What is the downside for setting higher MTU?
How would I know the proper value for MTU for my server?
I am using rhel 4 AS (2.6.9-42) , BroadCom Corporation NetXtreme II BCM5708 Gigabit Ethernet network Card and switch is 3Com® Baseline Switch 2948-SFP Plus.
Can’t set mtu > 1500 on Ubuntu 9.10. This sucks! I am trying to find tweaks to fool OS but no luck yet. It works in windows very well > 9000kb jumbo size frames!
sudo ethtool eth0
gives
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: g
Wake-on: g
Current message level: 0x000000ff (255)
Link detected: no
For the Fedora/RH/CentOS folks make sure there is an = in the line
MTU=9000
Sometimes it happens to be only a matter of mms, but it all depands on the module/driver rivision of your NIC. What version of the NDIS driver you said you are using? eradM@Pircher-spa.com
Help me. 🙂
I try change my MTU to 9000, but a receive this error (SIOCSIFMTU: Argumento inválido) . however i can change to 7004.
[root@xrafa rafael]# ifconfig eth0
eth0 Link encap:Ethernet Endereço de HW 00:26:9E:21:F2:D3
inet end.: 10.10.10.106 Bcast:10.10.10.255 Masc:255.255.255.0
endereço inet6: fe80::226:9eff:fe21:f2d3/64 Escopo:Link
UP BROADCASTRUNNING MULTICAST MTU:7004 Métrica:1
RX packets:21212 errors:0 dropped:0 overruns:0 frame:0
TX packets:15319 errors:0 dropped:0 overruns:0 carrier:0
colisões:0 txqueuelen:1000
RX bytes:24128672 (23.0 MiB) TX bytes:2527859 (2.4 MiB)
IRQ:31 Endereço de E/S:0xa000
[root@xrafa rafael]# ethtool eth0
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: MII
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: g
Current message level: 0x00000033 (51)
Link detected: yes
[root@xrafa rafael]# ifconfig eth0 mtu 9000
SIOCSIFMTU: Argumento inválido
Rafael, virgoptrex, maybe your driver is not supporting yet big MTUs. You can learn the driver you’re using with:
ethtool -i XXX
root@random# ethtool -i eth1
driver: igb
version: 2.1.1
firmware-version: 1.7-2
bus-info: 0000:05:00.1
FYI, some of the interfaces/chipsets do not support jumbo frames such as Intel’s 82573V.
ref:
http://ark.intel.com/products/26551/Intel-82573V-Gigabit-Ethernet-Controller
Hey all, I just noticed that a more helpful message is printed in the system log.
dmesg:
e1000: eth0: e1000_change_mtu: Jumbo Frames not supported.
Strangely the Supermicro board I have has dual Ethernet and the secondary interface supports Jumbo frames, but not the primary!
lspci:
04:00.0 Ethernet controller: Intel Corporation 82573E Gigabit Ethernet Controller
05:00.0 Ethernet controller: Intel Corporation 82573L Gigabit Ethernet Controller
The path in the article:
# vi /etc/sysconfig/network-script/ifcfg-eth0
Should be (scriptS, plural for CentOS/rhe):
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
Pretty sure the advmss value should say 8960…
1460 is the max seg size for MTU 1500…
can is set MTU 8192 to 1G nic card??
Speed: 1000Mb/s
Duplex: Full
I also want to configure two servers with a cross-over Cat6 cable, but still un-successful.
I am testing by sending big packets, as follows:
# ping -s 8972 192.168.0.20
#demsg
tg3 0000:03:00.1: eth1: Link is up at 1000 Mbps, full duplex
tg3 0000:03:00.1: eth1: Flow control is off for TX and off for RX
tg3 0000:03:00.1: eth1: EEE is disabled
Источник