Comments (6)
Yes, but in those time for us TCP/SSL sessions were more important, so I add analogical UDP benchmark just for brief comparison.
I'll think it over, maybe in near future we'll create benchmarking tests special for UDP.
from cppserver.
Yes. I have also found this to be very surprising. Can the developer please comment? TIA
from cppserver.
In TCP a stream buffer is used to put all outgoing messages together and send them in a batch with full IP packet. Batch mode is more effective.
In UDP a small datagram is send each time in a new IP packet which is not full.
It's just a kind of scenario. In other scenarios UDP could be more effective (e.g. broadcasting).
from cppserver.
from cppserver.
from cppserver.
With UDP packets fairly large, and with the benefit of a smaller header, the free´d capacity for more "packets" in batch mode doesn't explain a factor 100 in performance difference unless we go really close to 0 in packet size (payload size), or unless it is CPU limited and not throughput limited.
For 1 Gbps throughput limit, which should not be limit with test in same PC, a UDP packet totalling ~120 bytes including IP and UDP header should result in 1 million packets per second as each is ~1000 bits in size. But I am not getting close to those figures with UDP.
So is it a CPU constraint from CPU overhead at each packet transmission? I never did check the CPU usage...
By the way:
Appropriate send and receive buffer sizes on TCP could even things out, and disabling Nagle algorithm would also adress the stream vs datagram issues making UDP and TCP implementation more comparable.
from cppserver.
Related Issues (20)
- WHERE IS THE BUILD FOLDER ? HOT 1
- [help][docs] Sample project please
- Unable to compile sample UDP echo server HOT 3
- build error HOT 2
- M1 Mac stuck on UDP server tests
- HttpRequests doesn't work? HOT 8
- How to contorl tcp or udp transmission rate?
- Mac build error
- module not found anymore
- not handle websocket close status code
- install using vcpkg HOT 1
- Support PIC/user-defined build options HOT 2
- Memory leak HOT 1
- build HOT 2
- How to Use UDP Broadcast in Linux?
- Build Error in CppCommon
- Request: Allow specifying OpenSSL path HOT 1
- how to get the form-data?
- SSLClient ReconnectAsync() Access Violation on Windows Debug build
- I am getting wstring_convert deprecated error. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cppserver.