Trung BìnhNetwork iconNetwork

Latency vs Bandwidth vs Throughput: phân biệt và tối ưu như thế nào?

Latency (độ trễ per packet), Bandwidth (dung lượng tối đa), và Throughput (data thực sự truyền) là 3 metric khác nhau — tối ưu từng metric cần chiến lược riêng.

Latency: thời gian một packet đi từ A đến B (RTT = round-trip time). Bao gồm: propagation delay (tốc độ ánh sáng, không thể thay đổi), transmission delay (kích thước packet / bandwidth), processing delay (router, load balancer).

Bandwidth: dung lượng tối đa của đường truyền (Mbps/Gbps).

Throughput: data thực sự truyền được trong thực tế — bị ảnh hưởng bởi packet loss, latency, protocol overhead. Throughput ≤ bandwidth.

Bandwidth-Delay Product (BDP): bandwidth × RTT = số bytes 'in flight' tối đa. TCP window size phải >= BDP để không bottleneck.

Tối ưu latency: CDN (giảm physical distance), connection pooling (tránh TCP+TLS handshake mỗi request), HTTP/2 multiplexing, DNS prefetch, giảm số round-trips (batching).

Tối ưu throughput: compression (gzip/brotli giảm bytes), larger TCP window size, HTTP/2 server push, pipelining, tránh head-of-line blocking.

Tối ưu bandwidth: compression, binary protocol (protobuf thay vì JSON), image optimization, lazy loading.

Xem toàn bộ Network cùng filter theo level & chủ đề con.

Mở danh sách Network