How can I set the transmit queue length for a network interface on Mac OSX? On linux the command would be
ifconfig en0 txqueuelen 5
but OSX doesn't recognize txqueuelen as a valid option. Where does BSD manage this kind of configuration?
It is now possible to check the system defaults (send and receive queues):
sysctl net.link.generic.system.sndq_maxlen
sysctl net.link.generic.system.rcvq_maxlen
And to set the default transmit queue (current default 128) e.g.:
sysctl -w net.link.generic.system.sndq_maxlen=150
and default receive queue (current default 256) e.g.:
sysctl -w net.link.generic.system.rcvq_maxlen=260
It's unclear if it's possible to set a per interface queue length. The output queue length's default is set in the xnu kernel: bsd/net/if.h:#define IFQ_MAXLEN 128
On older kernels you used to be able to set the maximum input queue length on OSX as follows (e.g. to 100 packets) - which can be useful for tuning performance with incoming packets flows - it's the internal queue that packets are put when they come off the incoming interface:
sysctl -w net.inet.ip.intr_queue_maxlen=100
Usually, 'sysctl' is used for tuning TCP parameters. I looked through the output of
sysctl -a
and while I don't see anything that might be an exact match, there are a few possible parameters. I must point out that BSD and Linux differ greatly in their internals, and there might not be an analogous txqueuelen adjustment. (ie: the paradigm may not apply to MacOS's networking implementation)