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

Adjusted default # of threads of graphd to # of CPU cores #1094

Merged
merged 3 commits into from
Oct 21, 2019
Merged

Adjusted default # of threads of graphd to # of CPU cores #1094

merged 3 commits into from
Oct 21, 2019

Conversation

dutor
Copy link
Contributor

@dutor dutor commented Oct 16, 2019

As title.

@nebula-community-bot
Copy link
Member

Unit testing failed.

Copy link
Contributor

@whitewum whitewum left a 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.

Comment on lines +113 to 119
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;
}
Copy link
Contributor

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

Copy link
Contributor Author

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)

Comment on lines +122 to +128
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;
}
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Miss this option?

Copy link
Contributor Author

@dutor dutor Oct 16, 2019

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");
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

@nebula-community-bot
Copy link
Member

Unit testing passed.

@nebula-community-bot
Copy link
Member

Unit testing passed.

@dangleptr dangleptr merged commit e58faf9 into vesoft-inc:master Oct 21, 2019
@dutor dutor deleted the default-threads-num branch January 2, 2020 08:38
yixinglu pushed a commit to yixinglu/nebula that referenced this pull request Feb 16, 2020
tong-hao pushed a commit to tong-hao/nebula that referenced this pull request Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants