rt-n56u icon indicating copy to clipboard operation
rt-n56u copied to clipboard

wrong nf_conntrack_buckets settings?

Open pcslide opened this issue 3 years ago • 0 comments

我用小米R3g大概有一年多了,固件是2020年初我自己编译的,编译的时候修改参数非常少,肯定没动kernel设定。这路由器一直24小时稳定运行。 上周我给一台高通芯片的路由器编译OpenWrt固件,然后遇到了nf_conntrack参数设置,然后我就试着看看r3g的参数是怎么设置的,结果我发现 nf_conntrack_buckets=32768 nf_conntrack_max=8192 然而依照 https://www.kernel.org/doc/Documentation/networking/nf_conntrack-sysctl.txt nf_conntrack_buckets的数值应该是nf_conntrack_max的2到8倍才比较合理,nf_conntrack_buckets比nf_conntrack_max大是不应该的,hash表的大小设置成大于允许放入表中的条目的上限完全不合理。 而且256MB的机器又怎么可能装得下32768个nf_conntrack_buckets? 另外nf_conntrack_max数值是随着管理页面的Netfilter页面下的Maximum Connections设定而变化,但是nf_conntrack_buckets却一直是32768。 谁能告诉我这是什么原因?这是一个bug吗?

I used xiaomi r3g for more than 1 year now, with a firmware I compiled early 2020. It works without a glitch 24/7 . Yesterday I tried to compile OpenWrt for router with a QUALCOMM chipset , and encounter this nf_conntrack settings of the kernel. According to https://www.kernel.org/doc/Documentation/networking/nf_conntrack-sysctl.txt nf_conntrack_buckets seams like another name for hash table entries. I checked the settings on my r3g It surprised me nf_conntrack_buckets=32768, while nf_conntrack_max=8192 I understand the nf_conntrack_max was set according to the Maximum Connections on the WEB UI. My question is how could nf_conntrack_buckets be set to 32768 for a device with only 256MB ram? And it seems absurd that the hash table size is much more large than the allowed number of items.

pcslide avatar Sep 13 '21 03:09 pcslide