Linux Increasing The Transmit Queue Length (txqueuelen)

How do I set txqueuelen (the length of the transmit queue) length of the network card device under Linux? How do I set it for a high latency and/or a high speed network for bulk transfer from disturbing interactive traffic like ssh too much?

You can set the length of the transmit queue of the device using /sbin/ifconfig command as follows:

Advertisement

  1. Small value for slower devices with a high latency like modem links and ISDN.
  2. High value is recommend for server connected over the high-speed Internet connections that perform large data transfers.

Increasing The txqueuelen

Increase the txqueuelength parameter to a value between 1000 and 20000 per interface:

ifconfig ${interface} txqueuelen ${size}
ifconfig eth1 txqueuelen 10000
ifconfig eth0 txqueuelen 5000

Setting the txqueuelen permanently

Edit /etc/rc.locale, enter:
vi /etc/rc.local
Append the following setting per interface:

/sbin/ifconfig eth1 txqueuelen 10000
/sbin/ifconfig eth0 txqueuelen 10000

🥺 Was this helpful? Please add a comment to show your appreciation or feedback.

nixCrat Tux Pixel Penguin
Hi! 🤠
I'm Vivek Gite, and I write about Linux, macOS, Unix, IT, programming, infosec, and open source. Subscribe to my RSS feed or email newsletter for updates.

13 comments… add one
  • Rajesh Chaudhary Mar 18, 2015 @ 9:16

    This way you can only change the txqueuelen temporarily , /etc/rc.local runs at boot time, but when you restart your interface it will again set the txqueuelen value to default. here is the permanent way of fixing it. in below example i am setting txqueuelen to 5000 permanently. This value will remain same even after reboot of server or just interface restart/reset.

    edit /etc/sysconfig/network-script/ifup and place your command ” ifconfig eth2 txqueuelen 5000″ in beginning of the file ,just above line “unset WINDOW # defined by screen, conflicts with our usage”

  • Diego Oct 10, 2016 @ 15:37

    # cat <> /etc/rules.d/71-net-txqueuelen.rules
    SUBSYSTEM==”net”, ACTION==”add”, KERNEL==”eth*”, ATTR{tx_queue_len}=”10000″
    EOF

    udevadm trigger

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the site admin.