Dynamic

Traffic Policing vs Traffic Shaping

Developers should learn traffic policing when designing or managing network systems that require bandwidth control, such as in cloud services, enterprise networks, or internet service providers, to prevent traffic bursts from degrading performance meets pick tc/htb when you own the linux box doing the routing — a home gateway, a hypervisor host metering tenant vms, an isp edge box — and need free, kernel-level, per-class bandwidth control with borrowing. Here's our take.

🧊Nice Pick

Traffic Policing

Developers should learn traffic policing when designing or managing network systems that require bandwidth control, such as in cloud services, enterprise networks, or internet service providers, to prevent traffic bursts from degrading performance

Traffic Policing

Nice Pick

Developers should learn traffic policing when designing or managing network systems that require bandwidth control, such as in cloud services, enterprise networks, or internet service providers, to prevent traffic bursts from degrading performance

Pros

  • +It is essential for implementing QoS policies, limiting bandwidth for specific applications or users, and ensuring compliance with network contracts
  • +Related to: quality-of-service, network-traffic-management

Cons

  • -Specific tradeoffs depend on your use case

Traffic Shaping

Pick tc/HTB when you own the Linux box doing the routing — a home gateway, a hypervisor host metering tenant VMs, an ISP edge box — and need free, kernel-level, per-class bandwidth control with borrowing

Pros

  • +Do NOT reach for HTB to rate-limit an HTTP API; that's an L2/L3 packet queue, not a request counter
  • +Related to: linux-networking, iptables

Cons

  • -Specific tradeoffs depend on your use case

The Verdict

Use Traffic Policing if: You want it is essential for implementing qos policies, limiting bandwidth for specific applications or users, and ensuring compliance with network contracts and can live with specific tradeoffs depend on your use case.

Use Traffic Shaping if: You prioritize do not reach for htb to rate-limit an http api; that's an l2/l3 packet queue, not a request counter over what Traffic Policing offers.

🧊
The Bottom Line
Traffic Policing wins

Developers should learn traffic policing when designing or managing network systems that require bandwidth control, such as in cloud services, enterprise networks, or internet service providers, to prevent traffic bursts from degrading performance

Disagree with our pick? nice@nicepick.dev