TCP vs UDP Performance (Latency & Throughput) 🤯

preview_player
Показать описание

▬▬▬▬▬ Experience & Location 💼 ▬▬▬▬▬
► I’m a Senior Software Engineer at Juniper Networks (13+ years of experience)
► Located in San Francisco Bay Area, CA (US citizen)

▬▬▬▬▬▬ Connect with me 👋 ▬▬▬▬▬▬

▬▬▬▬▬▬▬ Timestamps ⏰ ▬▬▬▬▬▬▬
0:00 Intro
0:30 What is Performance?
1:41 TCP vs UDP
4:05 TCP vs UDP Direction
5:03 Code Overview
5:41 Test

▬▬▬▬▬▬▬ Source Code 📚 ▬▬▬▬▬▬▬

#tcp #udp #devops
Рекомендации по теме
Комментарии
Автор

pro tip: you are not measuring the protocol, you are measuring the implementation.

mossakehdjoshobouillant
Автор

You need to bypass the Linux network stack via XDP, then there will be udp 10-15 million messages per second, on a 100 gigabit channel. 300 thousand packets per second is very little for UDP. There, all the performance is lost on switching between the user context and the kernel context. XDP can process up to 20-30 million packets per second on a single core of a modern processor.

solenopsys-ru
Автор

JSON and performance in one sentence, interesting

hubert
Автор

Next video HTTP 1.1 VS HTTP 2 VS HTTP 3/QUIC please....

adityaprakashgupta
Автор

Pro tip: the linux network stack uses GRO (generic receive offload), which aggregates packets into a jumbo one (max 64kB), so the overhead caused by the journey of a packet within the kernel is reduced. This is enabled by default for tcp packets, but it is disabled for udp. I think this can be one of the reasons why the udp throughput is lower 🤙

omarferro
Автор

There is a imprecision about tcp and udp throuput, in tcp they can send multiple messages inside the same package, and udp dont, só if you are sendind a 110bytes udp, they will use the std frame size of 1500 bytes (depends of your l2 network configuration) regardless, but in tcp they can send multiple 110 bytes inside the same 1500 bytes frame, so this explains why the througput of tcp appears much greather than udp, but if you put the same size of the frame, you can see the throughput is the same if not bigger for udp. This explains why steam, torrent, ans a lot other download services uses udp to download and not tcp. Your test is not accurated.

crazynds
Автор

Would be interesting to see a comparison of TCP and QUIC

hankth
Автор

Please do one benchmark with TCP vs UDP vs QUIC

lucaslinhares
Автор

As a VPN provider I have tested TCP vs UPD performance a lot and for VPN wrapping encrypted network data in UDP is a most. UDP avoid TCP-meltdown phenomenon and is the best protocol to provide virtual networks around the Internet. Unfortunately, UDP traffic is blocked by almost all ISPs in my country. And we have to rely on TCP. It works but it is not as fast as TCP.

hmdz
Автор

Hey Anton, have you ever thought about creating a video ranking the SOTA architectures for performance? It would be great to summarize all the tests in a single video. Thanks.

blackpiller
Автор

Next Video Suggestion: RabbitMQ Queues vs NATS, KAFKA vs NATS Jetstream

papamoneyph
Автор

Great video as always. Looking forward to the sockets guide.

j.r.r.tolkien
Автор

TCP for Batch Data
UDP for Real-Time Data

wawan_ikhwan
Автор

Your tests are very interesting, please can you do HTTP, UDP and RPC tests?

apetitflores
Автор

that's very interesting, good job!

papryk
Автор

Thanks a lot. Just what I was looking for.

davidrehakcz
Автор

Would have been interesting to see QUIC includied

NFvidoJagg
Автор

Very bice video, could you please do Bunjs vs java? Been very curious about this

kephas-media
Автор

Something is very wrong if you're not able to get to a single gigabit when working directly with sockets 😬 You should at the very minimum be able to get 1+ million packets per second...

callowaysutton
Автор

Thank you
I think it's more beneficial to compare H3+BBR vs H2+BBR instead of uncongested raw UDP vs congested TCP

sinlessboy
visit shbcf.ru