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

Plumb CLI arg to control number of TVU receive threads/sockets #550

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

steviez
Copy link

@steviez steviez commented Apr 2, 2024

Problem

Want to be able to tune the number of sockets / streamer receiver threads we use to listen on the TVU port.

See #105 for more context

Summary of Changes

Plumb the number of TVU sockets to create from validator CLI. No change in behavior by default, the new named constant DEFAULT_NUM_TVU_SOCKETS has the same value (8) as a constant that previously resided within Node::new_with_external_ip()

@steviez steviez force-pushed the cli_num_tvu_sockets branch 2 times, most recently from 1f09442 to 1824566 Compare April 2, 2024 21:55
The parameter directly controls the number of sockets that are created;
the sockets later have one thread created per socket to listen.
@steviez steviez force-pushed the cli_num_tvu_sockets branch from 1824566 to b33f88f Compare April 2, 2024 22:00
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 25.00000% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 81.8%. Comparing base (4247a8a) to head (b33f88f).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #550   +/-   ##
=======================================
  Coverage    81.8%    81.8%           
=======================================
  Files         846      846           
  Lines      229148   229158   +10     
=======================================
+ Hits       187552   187569   +17     
+ Misses      41596    41589    -7     

@steviez steviez marked this pull request as ready for review April 3, 2024 04:18
Copy link

@gregcusack gregcusack left a comment

Choose a reason for hiding this comment

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

looks good for the most part. just some questions about unsafe and naming

gossip/src/cluster_info.rs Show resolved Hide resolved
validator/src/main.rs Show resolved Hide resolved
@gregcusack gregcusack self-requested a review April 4, 2024 05:18
Copy link

@gregcusack gregcusack left a comment

Choose a reason for hiding this comment

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

lgtm!

@behzadnouri
Copy link

Want to be able to tune the number of sockets / streamer receiver threads we use to listen on the TVU port.

Can this tuning be done by modifying the source and building from the source?

The downside I see with exposing these as the validator flags is that a) it makes validator flags even more crowded b) it makes it possible for node operators misspecifying these flags and causing more support burden.

@steviez
Copy link
Author

steviez commented Apr 4, 2024

a) it makes validator flags even more crowded

Fair point. However, I'll add this flag is currently hidden, as are the other num-thread arguments (such as the IP echo server one I pushed not too long ago).

b) it makes it possible for node operators misspecifying these flags and causing more support burden.

I think the argument being hidden mitigates some of this concern; --no-port-check has caused us support headache in the past but we kept it around as a hidden argument.

Can this tuning be done by modifying the source and building from the source?

Hypothetically, yes. Even though I'm creating this as a CLI arg, a subsequent PR would be to adjust the default to a well-tuned value after sufficient testing. That tuning could be done by adjusting the value and rebuilding from source as you mentioned

That being said, I still think there are some pros to having it configurable on the CLI (even if it is hidden and we have a "tuned" value as the default):

  • We tune for worst case / heaviest load (mnb), but proper tuning may vary by cluster
    • For example, we might need m threads for MNB but m/2 threads might be sufficient for testnet/devnet (ie we can use lesser hardware for smaller clusters)
  • Specialized uses-cases might want to tune differently to better that special case
    • For example, RPC nodes may be willing to allocate more threads to something
  • Having a CLI arg makes adjustments much easier in case of emergency
    • Again, I think there is a very high bar for testing to ensure that any changes here are proper, but having the ability to adjust without rebuilding a binary is nice just incase.

@steviez
Copy link
Author

steviez commented Apr 15, 2024

@behzadnouri - Did my latest response about the CLI arg being hidden address your concern ?

@behzadnouri
Copy link

@behzadnouri - Did my latest response about the CLI arg being hidden address your concern ?

No objections to merging.

@steviez steviez merged commit 7138ea7 into anza-xyz:master Apr 15, 2024
38 checks passed
@steviez steviez deleted the cli_num_tvu_sockets branch April 15, 2024 14:56
michaelschem pushed a commit to michaelschem/agave that referenced this pull request Apr 20, 2024
…xyz#550)

The parameter directly controls the number of sockets that are created;
the sockets later have one thread created per socket to listen.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

4 participants