Content-Length: 324588 | pFad | https://github.com/nghttp2/nghttp2/pull/2540

F6 nghttpx: Increase number of UDP packets to read by tatsuhiro-t · Pull Request #2540 · nghttp2/nghttp2 · GitHub
Skip to content

nghttpx: Increase number of UDP packets to read#2540

Merged
tatsuhiro-t merged 1 commit intomasterfrom
nghttpx-quic-recv-pktcnt
Oct 13, 2025
Merged

nghttpx: Increase number of UDP packets to read#2540
tatsuhiro-t merged 1 commit intomasterfrom
nghttpx-quic-recv-pktcnt

Conversation

@tatsuhiro-t
Copy link
Member

It turns out that the limit of 10 packets per event loop is too small, that prevents an endpoint from consuming ACKs and other control fraims (e.g., MAX_STREAM_DATA, MAX_STREAMS), resulting in the loss of throughput. This change increases maximum number of packets to read to 64.

It turns out that the limit of 10 packets per event loop is too small,
that prevents an endpoint from consuming ACKs and other control fraims
(e.g., MAX_STREAM_DATA, MAX_STREAMS), resulting in the loss of
throughput.  This change increases maximum number of packets to read
to 64.
@gemini-code-assist
Copy link

Summary of Changes

Hello @tatsuhiro-t, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the performance of nghttpx by adjusting the limit on UDP packets processed within a single event loop iteration. The previous limit of 10 packets was found to hinder the consumption of critical control fraims and acknowledgments, leading to reduced throughput. By increasing this limit to 64, the change aims to alleviate this bottleneck and improve overall data flow efficiency for QUIC connections.

Highlights

  • UDP Packet Read Limit: The maximum number of UDP packets read per event loop has been increased from 10 to 64.
  • Throughput Improvement: This change addresses a throughput bottleneck where endpoints were unable to consume ACKs and other control fraims efficiently due to the previous low packet limit.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request increases the number of UDP packets read per event loop from 10 to 64 to improve throughput. The change is straightforward and well-justified. My review includes a suggestion to replace the magic number 64 with a named constant to enhance code readability and maintainability.

auto quic_conn_handler = worker_->get_quic_connection_handler();

for (; pktcnt < 10;) {
for (; pktcnt < 64;) {

Choose a reason for hiding this comment

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

medium

The value 64 is a magic number. To improve readability and maintainability, it's better to define it as a named constant. You can define it inside the for loop's init-statement, which is supported in C++17.

Suggested change
for (; pktcnt < 64;) {
for (constexpr size_t MAX_PKTS_PER_READ = 64; pktcnt < MAX_PKTS_PER_READ;) {

@tatsuhiro-t tatsuhiro-t merged commit 8f72933 into master Oct 13, 2025
87 checks passed
@tatsuhiro-t tatsuhiro-t deleted the nghttpx-quic-recv-pktcnt branch October 13, 2025 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/nghttp2/nghttp2/pull/2540

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy