You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
I have some hosts that cannot receive full routing tables via BGP, so I wish to load them via a networks file. I've noticed a large performance difference between loading the IPv4 and IPv6 full routing tables from file. Loading the IPv6 table takes a very long time.
Thank you for reporting this issue. You are indeed right, i could reproduce the issue. The root cause is very simple, the algorithm to load data was written by these very hands 15+ years ago and is very inefficient (and very possibly, i bet, if you let it load, it will be rather inefficient / less scalable also at lookup time).
I would like to mark this issue as an Enhancement and see what is possible to improve the situation, very likely the algorithm has to be swapped for something more optimized where a tree is built. Should you be looking for a quick solution, though, the only recommendation i can offer is to load all the prefixes in something like ExaBGP and make it BGP Peer with your pmacct daemon. The config would need a couple of lines more a-la:
And the bgp_agent_map would be a one liner a-la: bgp_ip=<IP address used by ExaBGP to peer up> ip=0.0.0.0/0. Although not much involved, for sure it's more involved than just using a networks_file & i am sorry i can't offer any different quick solution.
Paolo
paololucente
changed the title
IPv6 networks.lst slow to load
Improve networks_file storage and load/query algorithm for IPv6 networks
Jan 27, 2023
Description
I have some hosts that cannot receive full routing tables via BGP, so I wish to load them via a networks file. I've noticed a large performance difference between loading the IPv4 and IPv6 full routing tables from file. Loading the IPv6 table takes a very long time.
Build and config
Steps to reproduce
Download IPv4 prefix list
# whois -h riswhois.ripe.net -- -F -M 0/0 | egrep -v "^%" | egrep -v "^$" | awk '{ print $1","$2; }' > networks.lst
# wc -l networks.lst
1093778 networks.lst
Start pmacctd
# /usr/local/sbin/pmacctd -f /etc/pmacct/pmacctd.conf -d
Wait until the loading is done
WARN ( default_print/print ): no print_output_file and no print_output_lock_file defined.
The load time is +/- 1 minute. During this time
v4 nh:
debug messages are continuously written to the screen while prefixes are being loaded.Download IPv6 prefix list
# whois -h riswhois.ripe.net -- -F -M ::/0 | egrep -v "^%" | egrep -v "^$" | awk '{ print $1","$2; }' > networks.lst
# wc -l networks.lst
224898 networks.lst
Start pmacctd
# /usr/local/sbin/pmacctd -f /etc/pmacct/pmacctd.conf -d
Wait until the loading is done.
WARN ( default_print/print ): no print_output_file and no print_output_lock_file defined.
The load time is +/- 13 minutes. Most of this time no output is written to the screen and the pmacctd process is spinning at 99.9% CPU. The long processing time is in step 4a,
bulding hierarchies
: https://github.com/pmacct/pmacct/blob/master/src/net_aggr.c#L1532-L1559Is this expected?
The text was updated successfully, but these errors were encountered: