Skip to content
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

DRAFT: Reduce buffer size of unused side of socket #3618

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gregcusack
Copy link

@gregcusack gregcusack commented Nov 13, 2024

Problem

We allocate large send and receive buffers for all sockets. However, not all sockets read and write to/from the buffers. In fact, 6 sockets are Read Only and 2 are Write Only. Meaning we are allocating memory that is never used.

Summary of Changes

  1. Reduce buffer sizes for the unused side of sockets down to 4 MB
  2. Update SocketConfig to use builder pattern
  3. Deprecate unused net-utils methods that use default SocketConfig

NOTE: i got rid of the default "bind" methods in net-utils/lib.rs so that developers are intentional about their socket allocations.

Services/Sockets
Read/Write

  1. Gossip
  2. RPC - TCP
  3. Ip_echo - TCP
  4. Tvu
  5. tvu_quic
  6. Repair
  7. Repair_quic
  8. Serve_repair
  9. Serve_repair_quic
  10. Ancestor_hashes_requests_quic
  11. Ancestor_hashes_requests

Read Only

  1. Tpu
  2. Tpu_forwards
  3. Tpu_vote
  4. Tpu_quic
  5. Tpu_forwards_quic
  6. Tpu_vote_quic

Write Only

  1. Retransmitter
  2. Broadcast

Follow Up PR:

  1. Make better sizing decisions for the sockets that don't need a full 128MB buffer

@gregcusack gregcusack force-pushed the reduce-buffer-size-when-unused branch 9 times, most recently from 2e93c1b to 7eccd6f Compare November 21, 2024 19:15
@gregcusack gregcusack force-pushed the reduce-buffer-size-when-unused branch 3 times, most recently from 9846357 to 114bac6 Compare December 3, 2024 23:58
@gregcusack gregcusack force-pushed the reduce-buffer-size-when-unused branch from 114bac6 to f601bd8 Compare December 4, 2024 00:24
@gregcusack gregcusack force-pushed the reduce-buffer-size-when-unused branch from f601bd8 to 89417f3 Compare December 4, 2024 00:38
@gregcusack gregcusack marked this pull request as ready for review December 4, 2024 06:33
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