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

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

ifconfig eth0 txqueuelen 10000

Either through the ip utility:

ip link set eth0 txqueuelen 1000

Check whether the value has increased:

ifconfig

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 eth0 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 eth0 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:
Configuring the Network in Linux

Подписаться на IT Blog (RU) по Email
Subscribe to IT Blog (EN) by Email

Did my article help you? How about buying me a cup of coffee as an encouragement? Buy me a coffe.

Leave a Reply