-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Adjusted default # of threads of graphd to # of CPU cores #1094
Conversation
Unit testing failed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK with minor questions.
if (FLAGS_num_netio_threads == 0) { | ||
FLAGS_num_netio_threads = std::thread::hardware_concurrency(); | ||
} | ||
if (FLAGS_num_netio_threads <= 0) { | ||
LOG(WARNING) << "Number of networking IO threads should be greater than zero"; | ||
return EXIT_FAILURE; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
combine these two conditions ?
My thought: FLAGS_num_netio_threads <= 0 means all cores
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0
is to be a legal option and the only option to indicate number of cores, while a negative value is not. The second check is to cover the negative AND the failure case(hard_concurrency
has chances to fail)
if (FLAGS_num_worker_threads == 0) { | ||
FLAGS_num_worker_threads = std::thread::hardware_concurrency(); | ||
} | ||
if (FLAGS_num_worker_threads <= 0) { | ||
LOG(WARNING) << "Number of worker threads should be greater than zero"; | ||
return EXIT_FAILURE; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto?
@@ -36,10 +36,10 @@ | |||
--session_idle_timeout_secs=60000 | |||
# The number of threads to accept incoming connections | |||
--num_accept_threads=1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Miss this option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Miss this option?
Nope. Mostly, one single thread is enough to handle incomming connections.
@@ -16,7 +16,7 @@ DEFINE_int32(session_reclaim_interval_secs, 10, "Period we try to reclaim expire | |||
DEFINE_int32(num_netio_threads, 0, | |||
"Number of networking threads, 0 for number of physical CPU cores"); | |||
DEFINE_int32(num_accept_threads, 1, "Number of threads to accept incoming connections"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
Unit testing passed. |
Unit testing passed. |
As title.