enhancement(performance): udp batch implementation (experiment)#25431
enhancement(performance): udp batch implementation (experiment)#25431splitice wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 334f45c905
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| use std::io; | ||
| use std::{ | ||
| io, | ||
| net::{Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6, UdpSocket as StdUdpSocket}, |
There was a problem hiding this comment.
Guard Linux-only imports with cfg
Move Ipv6Addr, SocketAddrV6, and StdUdpSocket behind #[cfg(target_os = "linux")] (or split the use block), because this crate has #![deny(warnings)] and these names are unused when compiling for non-Linux targets. In that context (e.g., Windows/macOS builds with sources-utils-net-udp enabled), unused_imports becomes a hard error and the build fails before tests run.
Useful? React with 👍 / 👎.
Summary
Adds UDP batching for linux using recvmmsg. To close #12452
Only used on Linux. All other systems to use normal recvmsg.
Vector configuration
TODO
How did you test this PR?
cargo testin WSL &cargo teston Debian Trixie serverNo test failures that were not pre-existing on those systems. Part of the reason to create this PR is to see what the CI says.
Change Type
Is this a breaking change?
Does this PR include user facing changes?
I left configuring the batch size etc to a later PR if such a feature is desirable. I used a conservative value of 32 for now which should be enough that everyone gets a benifit but without any substantial memory increases.
no-changeloglabel to this PR.References
Closes: #12452
Notes
@vectordotdev/vectorto reach out to us regarding this PR.pre-pushhook, please see this template.make fmtmake check-clippy(if there are failures it's possible some of them can be fixed withmake clippy-fix)make testgit merge origin masterandgit push.Cargo.lock), pleaserun
make build-licensesto regenerate the license inventory and commit the changes (if any). More details on the dd-rust-license-tool.