You might want to consider using the `-maxuploadtarget` option. From the wiki :
Thanks for your suggestion but maxuploadtarget only helps people with limited traffic quota. It helps to maintain the traffic quota below the figure set by the ISP. It will not help us preventing our network interface from being saturated on uplink by the peers with much higher downlink bandwidth capabilities, e.g. in Gbps level.
How about 80:20 rule (or sometimes called Parreto rules)? It's good option for managing bandwidth.
Obviously 80% goes to your full nodes and you need to measure maximum/average bandwidth first.
I have already tried to implement that 80:20 rule before with tc HTB qdisc, so 80% bitcoin traffic and 20% other traffic. But since I have only 100 Mbps on uplink, that makes me have only 80 Mbps for bitcoin traffic. As soon as a peer with much higher downlink capability occupies the whole bandwidth, my full node could not serve the requests from other peers.
I could indeed add more classes on the HTB for each peer. But my traffic shaper will become more complex as the peers can very dynamically come and go anytime. So I think I will stick with a simple hashlimit on my iptable to limit the uplink traffic to 2 Mbps per IP:port pair of the peers. From what I observed, a peer some times have multiple connections with the same IP address to my full node.
As of my writing, there is a peer which has been downloading blocks from my full node for more than 3 hours.
Its status when it was downloading the blocks for about 30 minutes is as below (that peer is the first one on the list).
And about 2.5 hours later, it was still downloading up to about 2.8 GB as below
As it seems to provide full service (services = 0x40d) and it looks like legitimate /Satoshi:0.17.1/, I let it keep downloading blocks as it is harmless anyway to other peers as it can only download with the speed below 2 Mbps (thanks to iptables hashlimit) as shown on some parts of iftop output below.
=> 216.21.162.208:35166 1.98Mb 1.95Mb 1.85Mb
=> 150.109.74.119:39375 20.5Kb 4.09Kb 2.59Kb
=> 84.26.108.54:8333 0b 3.71Kb 3.22Kb
=> 88.25.100.45:63935 14.1Kb 3.17Kb 1.67Kb
=> 185.25.224.202:8333 8.45Kb 3.16Kb 2.79Kb
=> 88.99.186.25:50854 11.0Kb 2.62Kb 2.11Kb
=> [2a01:4f8:141:4d7::2]:8333 2.16Kb 2.45Kb 1.96Kb
=> [2a03:b0c0:2:d0::4bc:2001]:38160 10.7Kb 2.34Kb 1.81Kb
=> [2a01:4f8:10a:37ee::2]:25424 10.7Kb 2.30Kb 1.71Kb
=> 158.109.79.23:55301 10.4Kb 2.23Kb 1.66Kb
=> 188.166.69.73:45169 10.4Kb 2.23Kb 1.72Kb
=> 129.13.88.177:59646 10.4Kb 2.23Kb 1.66Kb
=> [2a04:3544:1000:1510:b08f:6fff:fe1b:3007]:55612 10.7Kb 2.15Kb 1.76Kb
=> [2a00:1398:4:2a00::a5]:42533 10.7Kb 2.15Kb 1.73Kb
=> [2a00:1398:4:2a01::78]:35724 10.7Kb 2.15Kb 1.71Kb
=> [2a00:1398:4:2a01::77]:44310 10.7Kb 2.15Kb 1.63Kb
=> 150.109.74.119:45717 10.4Kb 2.09Kb 2.10Kb
=> 23.92.36.2:56913 10.4Kb 2.09Kb 1.67Kb
=> 94.237.44.67:48927 10.4Kb 2.09Kb 1.66Kb
=> 129.13.252.36:55358 10.4Kb 2.09Kb 1.66Kb
=> 88.99.167.186:14287 10.4Kb 2.09Kb 1.59Kb
=> 162.218.65.27:53265 10.4Kb 2.09Kb 1.59Kb
=> 129.13.88.175:58702 10.4Kb 2.09Kb 1.59Kb
=> 188.65.213.21:49201 10.4Kb 2.09Kb 1.59Kb
=> 162.218.65.53:13354 10.4Kb 2.09Kb 1.59Kb
=> 162.218.65.236:10183 10.4Kb 2.09Kb 1.59Kb
=> 183.205.191.79:22241 6.82Kb 1.84Kb 1.18Kb
=> [2001:41d0:2:af72::1]:8333 1.50Kb 1.75Kb 1.21Kb
=> 185.53.156.255:50501 6.16Kb 1.58Kb 1.66Kb
=> 13.209.125.83:8333 208b 1.36Kb 1.39Kb
=> [2a02:8388:2282:f900:e29d:31ff:fe26:2628]:50256 2.59Kb 1.29Kb 2.01Kb
=> 162.209.88.174:8333 1.82Kb 1.26Kb 1.63Kb
=> 47.6.34.160:8333 1.13Kb 1.24Kb 1.33Kb
=> 94.237.44.67:35799 3.49Kb 1.02Kb 524b
=> 158.109.79.23:61545 0b 0.98Kb 500b
=> 80.110.127.178:9282 1.05Kb 943b 854b
=> 84.73.200.108:8333 804b 526b 1.68Kb
=> 185.220.101.66:39843 2.23Kb 520b 2.15Kb
=> 59.110.8.18:34358 864b 173b 86b
=> 59.110.8.18:33241 0b 173b 86b
=> 59.110.8.18:58310 0b 0b 86b
=> 129.13.88.178:43591 0b 0b 0b
=> 129.13.72.197:43591 0b 0b 0b