Skip to content

perf(networking): optimize TCP throughput for high-speed downloads#51

Merged
pradosh-arduino merged 1 commit into
mainfrom
optimize/networking-performance
Jul 5, 2026
Merged

perf(networking): optimize TCP throughput for high-speed downloads#51
pradosh-arduino merged 1 commit into
mainfrom
optimize/networking-performance

Conversation

@pradosh-arduino

Copy link
Copy Markdown
Collaborator

Performance improvements:

  • Increase TCP_RX_BUF_SIZE from 16KB to 64KB to prevent packet drops during high-throughput transfers and allow proper buffering
  • Advertise full TCP_RX_BUF_SIZE (65536) instead of fixed 4096 bytes in window size, allowing senders to pump data without artificial throttling
  • Increase TCP maximum payload from 1024 to 1460 bytes (typical MTU - headers), reducing round-trips and improving efficiency
  • Update buffer allocations in http_get_to_file to use TCP_MAX_PAYLOAD for consistency

These changes directly address the bottlenecks causing slow wget transfers by:

  1. Eliminating artificial buffer limits that cause retransmissions
  2. Allowing the remote sender to transmit at line speed instead of being artificially throttled by a small window
  3. Reducing protocol overhead per byte transferred

The main bottleneck shifts from OS to network provider as intended.

Performance improvements:
- Increase TCP_RX_BUF_SIZE from 16KB to 64KB to prevent packet drops during
  high-throughput transfers and allow proper buffering
- Advertise full TCP_RX_BUF_SIZE (65536) instead of fixed 4096 bytes in window
  size, allowing senders to pump data without artificial throttling
- Increase TCP maximum payload from 1024 to 1460 bytes (typical MTU - headers),
  reducing round-trips and improving efficiency
- Update buffer allocations in http_get_to_file to use TCP_MAX_PAYLOAD for
  consistency

These changes directly address the bottlenecks causing slow wget transfers by:
1. Eliminating artificial buffer limits that cause retransmissions
2. Allowing the remote sender to transmit at line speed instead of being
   artificially throttled by a small window
3. Reducing protocol overhead per byte transferred

The main bottleneck shifts from OS to network provider as intended.
@pradosh-arduino pradosh-arduino merged commit 9557c44 into main Jul 5, 2026
2 checks passed
@pradosh-arduino pradosh-arduino deleted the optimize/networking-performance branch July 5, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant