We have a Linux project where we are pushing struct information over buffers. Recently, we found that the kernel parameter optmem_max was too small. I was asked to increase this by a supervisor. While I understand how to do this, I don't really understand how I know how big to make this.
Further, I don't really get what optmem_max is.
Here's what the kernel documentation says:
"Maximum ancillary buffer size allowed per socket. Ancillary data is a sequence of struct cmsghdr structures with appended data."
(I don't really understand what this means in English).
I see many examples on the Internet suggesting that this should be increased for better performance.
In:
/etc/sysctl.conf
I added this line to fix the problem:
net.core.optmem_max=1020000
Once this is done, we got better performance.
So to summarize my question:
In English, what is optmem_max?
Why is it so low by default in most Linux distros if making it bigger improves performance?
How does one measure what a good size for this number to be?
What are the ramifications of making this really large?
Aside from /etc/sysctl.conf, where is this set in the kernel by default? I grepped the kernel, but I could find no trace of the default value of optmem_max being set to 20480 which is the default on our system.