Skip to content

enhancement(performance): udp batch implementation (experiment)#25431

Open
splitice wants to merge 1 commit into
vectordotdev:masterfrom
X4BNet:feat/udp-batch
Open

enhancement(performance): udp batch implementation (experiment)#25431
splitice wants to merge 1 commit into
vectordotdev:masterfrom
X4BNet:feat/udp-batch

Conversation

@splitice
Copy link
Copy Markdown
Contributor

@splitice splitice commented May 14, 2026

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 test in WSL & cargo test on Debian Trixie server

No 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

  • Bug fix
  • New feature
  • Dependencies
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

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.

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

References

Closes: #12452

Notes

  • Please read our Vector contributor resources.
  • Do not hesitate to use @vectordotdev/vector to reach out to us regarding this PR.
  • Some CI checks run only after we manually approve them.
    • We recommend adding a pre-push hook, please see this template.
    • Alternatively, we recommend running the following locally before pushing to the remote branch:
      • make fmt
      • make check-clippy (if there are failures it's possible some of them can be fixed with make clippy-fix)
      • make test
  • After a review is requested, please avoid force pushes to help us review incrementally.
    • Feel free to push as many commits as you want. They will be squashed into one before merging.
    • For example, you can run git merge origin master and git push.
  • If this PR introduces changes Vector dependencies (modifies Cargo.lock), please
    run make build-licenses to regenerate the license inventory and commit the changes (if any). More details on the dd-rust-license-tool.

@splitice splitice requested a review from a team as a code owner May 14, 2026 04:52
@github-actions github-actions Bot added the domain: sources Anything related to the Vector's sources label May 14, 2026
@splitice splitice changed the title enhancement(udp): udp batch implementation (experiment) enhancement(performance): udp batch implementation (experiment) May 14, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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},
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: sources Anything related to the Vector's sources

Projects

None yet

Development

Successfully merging this pull request may close these issues.

performance: UDP recvmmsg instead of recvfrom

1 participant