coreos / go-iptables

Go wrapper around iptables utility
Apache License 2.0
1.14k stars 257 forks source link

Adds ability to use iptables-restore #124

Open trozet opened 7 months ago

trozet commented 7 months ago

This improves efficiency when adding a lot of rules to a table. Rather than calling insert or append for each rule, we can execute one iptables operation to replace them all.

This was identified to greatly improve the performance in ovn-kubernetes. The overall time of installing 1000 rules was taking 4.8 seconds by insert operations. By moving to this commit it only takes .058 seconds.

https://github.com/ovn-org/ovn-kubernetes/pull/4241

https://github.com/ovn-org/ovn-kubernetes/pull/4241#issuecomment-2026167282

trozet commented 7 months ago

@squeed can you PTAL?

jcaamano commented 5 months ago

@jcaamano tagging me here