Changing txqueuelen on Linux

Changing txqueuelen allows you to set the length of the data queue for network interfaces when the queue reaches the specified value of txqueuelen, then the data is transmitted, the less traffic is less the value of txqueuelen, the larger traffic – txqueuelen can be increased.

Let’s look at the current value of txqueuelen for each network interface:

ifconfig
ifconfig ens1f0
ifconfig ens1f1

In my case, txqueuelen in Ubuntu Server 18.04 is standard and equal to 1000, let’s say a very large traffic passes through the network interface, e.g. 6 gigabits per second and we want to increase the value, for this we execute the command:

ifconfig ens1f0 txqueuelen 10000

Either through the ip utility:

ip link set ens1f0 txqueuelen 10000

Check whether the value has increased:

ifconfig ens1f0

So that after the system reboot the changes are not reset, open the file /etc/network/interfaces eg in the text editor nano:

sudo nano /etc/network/interfaces

And add at the end of the line:

post-up /sbin/ifconfig ens1f0 txqueuelen 10000

Alternatively, you can open the /etc/rc.local file:

sudo nano /etc/rc.local

And add a line before the line “exit 0”:

/sbin/ifconfig ens1f0 txqueuelen 10000

In both cases, after the system was rebooted, the txqueuelen value was set correctly.
Similarly, you can specify “ip” instead of “ifconfig”.

See also my article:
Configuring the Network in Linux

Leave a comment

Leave a Reply