Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 May 2018 21:09:54 +0700
From:      Eugene Grosbein <eugen@grosbein.net>
To:        rs@logitravel.com, freebsd-net@freebsd.org
Subject:   Re: Fwd: systat -ip, socket buffer full
Message-ID:  <5B081932.8070006@grosbein.net>
In-Reply-To: <CAAG%2B3oV-i55_8xVvhe8R_cTzecW9MkdkvK_jFO3Fu24A=MW5_Q@mail.gmail.com>
References:  <CAAG%2B3oXo03mO%2BUfOvz4fVPeN2QjxfVW7%2ByeV6nBSzxD=wZLfbQ@mail.gmail.com> <5B07012D.4050003@grosbein.net> <CAAG%2B3oV31hJXUKupB-UcoU%2BS2mwO1OdMJNRe2c0ZHX9Qfm7Q=w@mail.gmail.com> <CAAG%2B3oV-i55_8xVvhe8R_cTzecW9MkdkvK_jFO3Fu24A=MW5_Q@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 25.05.2018 18:28, Raimund Sacherer wrote:

>>> when checking systat -ip I see the value for "socket buffer full" with
>>> values different from 0, I see 1, 2, up to 55 in one occasion.
>>> I asked on IRC and it was mentioned I should try to up
>>> kern.ipc.soacceptqueue to 1024 from the default 128, but I could still see
>>> values over 0 in "socket buffer full".
>>> How can I tune this buffer?
>>>
>>> We have a lot of UDP traffic (the server is a PBX serving around 200 agents
>>> with avg 50 concurrent calls.
>>
>> Each (udp) socket has its own limit on receiving buffer size and it is
>> application's duty
>> to set its size to right value using setsockopt() function.
>> You should read your PBX manual on how to configure it to use larger
>> buffers.
>>
> I will check this out.

>> As last resort, you can raise sysctl kern.ipc.maxsockbuf that establishes
>> default value
>> for size of such buffers that is used when application does not change
>> defaults.
>> However, it may affect many applications in the system and lead to
>> overflow of kernel memory pools
>> unless you know what are you doing, has plenty of free physical memory and
>> raised kernel limits
>> accordingly, so better start with PBX documentation.
>>
> Thank you, I might try that, i checked and the value on my system is
> 2097152. How can I check if I hit this buffer wall? Is there a monitoring
> tool which can tell me more stats about this buffer use?

As I've already said, there is no such single buffer: each udp socket has its own.
You can use "netstat -nx" to see usage of buffers. Read "man netstat" to learn
how to read its output.

You should probably increase both of sysctl net.inet.udp.recvspace (effective size of per-socket buffer)
and sysctl kern.ipc.maxsockbuf (limit on sending + receiving socket buffers for several protocols).

Again, application settings should serve much better.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5B081932.8070006>