पाठ 12 / 30

Bandwidth, Ingress and Egress

यह पाठ अभी हिंदी में अनुवादित नहीं है, इसलिए अंग्रेज़ी में दिखाया जा रहा है।

Estimate network bandwidth for uploads and downloads and see why egress and CDNs matter for cost.

लेखक: · 15 साल से वेब डेवलपर

Bandwidth = rate x size

Network bandwidth follows the same pattern as storage but per second: requests per second x bytes per request. Do it twice. Ingress is data coming into your system, such as uploads. Egress is data leaving it, such as page loads, images and video streams, and for consumer apps egress is usually much larger because each object is uploaded once and viewed many times. Convert bytes to bits (x8) when comparing with link capacities quoted in Gbps. Bandwidth matters for two reasons. Capacity: a server's network interface or a load balancer can saturate before the CPU does, especially for media. Cost: major cloud providers commonly charge for data transferred out to the internet, while inbound transfer is often free or cheap, so egress can become one of the largest bills. A CDN caches content at edge locations close to users, cutting latency and shifting most egress away from your origin servers.

Video egress estimate

A short-video app's peak egress, in Gbps.

concurrent_viewers = 500_000
bitrate_mbps = 2.5          # average stream bitrate
cdn_hit_ratio = 0.95

total_gbps = concurrent_viewers * bitrate_mbps / 1000
origin_gbps = total_gbps * (1 - cdn_hit_ratio)
print(f"total egress to users : {total_gbps:,.0f} Gbps")
print(f"served by origin      : {origin_gbps:,.1f} Gbps")

Output:

total egress to users : 1,250 Gbps
served by origin      : 62.5 Gbps

Concurrency, not daily totals

For streaming, estimate concurrent viewers at peak multiplied by bitrate. Daily totals averaged over 24 hours hide the evening peak that saturates links.

त्वरित जाँच: Why is egress often a bigger cost concern than ingress for a consumer media app?

  • Egress is slower than ingress
  • Each object is uploaded once but downloaded many times, and providers commonly charge for outbound transfer
  • Ingress requires a CDN
  • Egress cannot be compressed
Answer

Each object is uploaded once but downloaded many times, and providers commonly charge for outbound transfer — Download volume is multiplied by the number of views, and outbound internet transfer is the direction cloud providers typically bill. CDNs and compression reduce it.