Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
210360228
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2021
210360228
Commits
5e796821
Commit
5e796821
authored
5 years ago
by
dutor
Committed by
dangleptr
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Adjusted default # of threads of graphd to # of CPU cores (#1094)
parent
ae1bd902
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
conf/nebula-graphd.conf.default
+5
-5
5 additions, 5 deletions
conf/nebula-graphd.conf.default
src/daemons/GraphDaemon.cpp
+14
-0
14 additions, 0 deletions
src/daemons/GraphDaemon.cpp
src/executor/GraphFlags.cpp
+1
-1
1 addition, 1 deletion
src/executor/GraphFlags.cpp
with
20 additions
and
6 deletions
conf/nebula-graphd.conf.default
+
5
−
5
View file @
5e796821
...
...
@@ -10,7 +10,7 @@
# Log level, 0, 1, 2, 3 for INFO, WARNING, ERROR, FATAL respectively
--minloglevel=0
# Verbose log level, 1, 2, 3, 4, the higher of the level, the more verbose of the logging
--v=
4
--v=
0
# Maximum seconds to buffer the log messages
--logbufsecs=0
# Whether to redirect stdout and stderr to separate output files
...
...
@@ -36,10 +36,10 @@
--session_idle_timeout_secs=60000
# The number of threads to accept incoming connections
--num_accept_threads=1
# The number of networking IO threads
--num_netio_threads=
1
# The number of threads to execute user queries
--num_worker_threads=
1
# The number of networking IO threads
, 0 for # of CPU cores
--num_netio_threads=
0
# The number of threads to execute user queries
, 0 for # of CPU cores
--num_worker_threads=
0
# HTTP service ip
--ws_ip=127.0.0.1
# HTTP service port
...
...
This diff is collapsed.
Click to expand it.
src/daemons/GraphDaemon.cpp
+
14
−
0
View file @
5e796821
...
...
@@ -110,10 +110,24 @@ int main(int argc, char *argv[]) {
return
EXIT_FAILURE
;
}
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
;
}
LOG
(
INFO
)
<<
"Number of networking IO threads: "
<<
FLAGS_num_netio_threads
;
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
;
}
LOG
(
INFO
)
<<
"Number of worker threads: "
<<
FLAGS_num_worker_threads
;
auto
threadFactory
=
std
::
make_shared
<
folly
::
NamedThreadFactory
>
(
"graph-netio"
);
auto
ioThreadPool
=
std
::
make_shared
<
folly
::
IOThreadPoolExecutor
>
(
FLAGS_num_netio_threads
,
std
::
move
(
threadFactory
));
...
...
This diff is collapsed.
Click to expand it.
src/executor/GraphFlags.cpp
+
1
−
1
View file @
5e796821
...
...
@@ -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"
);
DEFINE_int32
(
num_worker_threads
,
1
,
"Number of threads to execute user queries"
);
DEFINE_int32
(
num_worker_threads
,
0
,
"Number of threads to execute user queries"
);
DEFINE_bool
(
reuse_port
,
true
,
"Whether to turn on the SO_REUSEPORT option"
);
DEFINE_int32
(
listen_backlog
,
1024
,
"Backlog of the listen socket"
);
DEFINE_string
(
listen_netdev
,
"any"
,
"The network device to listen on"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment