Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: refine ipset hashsize #4089

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

giveup
Copy link

@giveup giveup commented Oct 5, 2024

大部分情况下应该不会超过16384和4096

root@CT3003:/etc/openclash# cat china_ip_route.ipset | wc -l
8661
root@CT3003:/etc/openclash# cat china_ip6_route.ipset | wc -l
2025
root@CT3003:/etc/openclash# 

@vernesong
Copy link
Owner

修改这个的用意是啥?表大小是无法预期的

@giveup
Copy link
Author

giveup commented Oct 5, 2024

根据我自己查阅的一些资料,更大的ipset集合大小会消耗更多内存。对于嵌入式设备(比如路由器)等资源紧张的设备,应该合理分配大小。
另外表的大小时可以预估的。目前ipset的来源主要是苍狼山庄手动分析后,对于ipv4,IP数量不超过10000个,对于ipv6,其大小不超过2048。考虑到未来可能的增长,调整为16384和4096应该足够。
对于GeoIP2-CN,其ipv4数量为7187

@vernesong
Copy link
Owner

初始大小是1024,maxelem只是最大限制,不会直接分配

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants