-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
liburing #1218
Conversation
Enable liburing usage for linux (kernel versions >= 6). Use liburing to relay incoming RTP to Consumers. This greately reduces the number of system calls as just a single system call is needed to relay the incoming RTP packet to "every" Consumer, opposite to libuv which requires a system call to relay the RTP packet to "each" Consumer. For efficiency, memory buffers are preallocated holding the data payload being sent.
Okay, I'm glad you've tested it with positive outcome! |
What does this mean exactly? |
In my tests you'll see the difference when larg-ish Routers, but not with small/normal ones. Testing with >200 consumers you'll see a noticeable difference. |
That makes a lot of sense and is to be expected. Squeezing more performance out of the same CPU core is always nice. |
The CPU usage is more stable, it shows less spikes. |
The binary could have been prebuilt in a linux machine with kernel version >= 6, but then such image could be run on an older kernel. We need to check the kernel version in runtime and only enable the feature when appropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it now. Is it ready? Are you gonna add those entries we discussed into the dump data? Or in another PR?
Thanks, I'll do few changes in this PR and add those dump data too. I'll notify you once done. |
RTP packets are retransmitted in batch, determined by the NACK RTCP packet. Make use of a single system call to send all Nacked packets.
Take advantage of a single system call when sending multiple compound packets.
The macro MS_LIBURING_SUPPORTED indicates that liburing capabilities are contained in the binary. IsRuntimeSupported() indicates whether the runtime can make use of such capabilities.
@ibc, the initial version of liburing is ready to merge. Can you please take a look at today's 4 commits?
|
Hello, I'm working on udp syscall tunning on my local server, and trying lots of linux feature. IOUring seems to be a good solution, but how about |
You don't send multiple RTP packets in a raw to the same socket in mediasoup, but the "same" RTP packet from a Producer, to multiple sockets.
This PR is about using |
Enable liburing usage for linux (kernel versions >= 6).
Use liburing to relay incoming RTP to Consumers. This greately reduces the number of system calls as just a single system call is needed to relay the incoming RTP packet to "every" Consumer, opposite to libuv which requires a system call to relay the RTP packet to "each" Consumer.
For efficiency, memory buffers are preallocated holding the data payload being sent.
NOTE: The numbers are really positive. Not only the CPU usage is reduced but it's also more stable.