What is the default size of datagram queue length in Unix Domain Sockets (AF_UNIX)? Is it configurable?
Asked Answered
L

2

8

I know the maximum length of a datagram queue length can be found using "cat /proc/sys/net/unix/max_dgram_qlen".

I wanted to know how to find the default value that is set on boot up (like in case of the /proc/sys/net/core/wmem_default for the send buffer size).

Is it possible to increase the value of max_dgram_qlen? What is the upper limit of the same?

My kernel version is 2.6.27.7. I'm new to Unix Domain Socket programming (AF_UNIX).

Thanks in advance for any comments / solutions!

Lachellelaches answered 30/1, 2014 at 6:0 Comment(0)
A
8

The previous answers/comments failed to understand that the OP was talking about maximum queue length in datagrams (max_dram_qlen) and not in bytes. The OS provides settings for both sizes.

You can set max_dgram_qlen using the following command:

sysctl net.unix.max_dgram_qlen=128

You may need to run with sudo and you may also need to put double quotes around max_dgram_qlen=128 depending on your shell.

Also, see What's the practical limit on the size of single packet transmitted over domain socket?.

Aniela answered 7/7, 2015 at 22:48 Comment(0)
M
1

man unix(7):

The SO_SNDBUF socket option does have an effect for UNIX domain sockets, but the SO_RCVBUF option does not. For datagram sockets, the SO_SNDBUF value imposes an upper limit on the size of outgoing datagrams. This limit is calculated as the doubled (see socket(7)) option value less 32 bytes used for overhead.

Mendicant answered 30/1, 2014 at 9:45 Comment(3)
Thanks Maxim for your reply. I agree the SO_SNDBUF dictates the upper limit of the size of outgoing datagrams. But, i wanted to know the default value of the queue in which first all the outgoing datagrams are queued up.Lachellelaches
@Lachellelaches It's in your question, /proc/sys/net/core/wmem_defaultModulation
@Lachellelaches You can find the socket buffer size programatically using getsockopt().Mendicant

© 2022 - 2024 — McMap. All rights reserved.