Is there a way to increase the limit of 20 multicast groups that you can join on a given socket? Is there some system setting that I am missing or is there some hard limit which cannot be exceeded?
2 Answers
Well, incase someone is searching for this, the following parameter exists:
/proc/sys/net/ipv4/igmp_max_memberships Currently my install says 20, in the sources, I also see:
bits/in.h:#define IP_MAX_MEMBERSHIPS 20 I think bumping up the system parameter may be enough, else will have to patch the header as well!
EDIT: looks like bumping up the system parameter does the trick.
From Fernando Garcia over on rti:
Modify
net.ipv4.igmp_max_membershipsin/etc/sysctl.conf.You can reload the configuration file by using
sysctl -por by rebooting your system.
In my case, the line didn't exist, so I had to append it. Here's an example with a new limit of 75:
net.ipv4.igmp_max_memberships = 75 Note that this differs from the answer by @Nim in that it makes the change permanent, whereas changing the value in /proc/sys/net/ipv4/max_igmp_memberships will only change the value for the current session, until log out.
- Please do not post comments to an answer as an answer in its own right. Once you have sufficient reputation, you will be able to comment on any post.AdminBee– AdminBee2020-02-05 14:28:47 +00:00Commented Feb 5, 2020 at 14:28
- 1I figured it held as its own answer, since it is a different method of achieving the sets the max memberships. It sets it permanently, whereas the first answer sets it only until the next boot. Do you disagree? The first sentence does make it sound like a comment, I agree with that. Should I remove it?PhilippeAtM– PhilippeAtM2020-02-05 14:53:29 +00:00Commented Feb 5, 2020 at 14:53
- 2I think you are right, but would recommend rephrasing the first sentence to avoid giving the impression of a "comment as answer" post. Thank you for taking the time to consider the issue.AdminBee– AdminBee2020-02-05 15:08:50 +00:00Commented Feb 5, 2020 at 15:08
- Please rephrase the text as a self-contained answer. Users have already flagged it as "not an answer".2020-02-05 15:29:03 +00:00Commented Feb 5, 2020 at 15:29