diff --git a/conf/nebula-graphd.conf.default b/conf/nebula-graphd.conf.default index 6d1017a641c8f496701077db1e52d7ead4022a17..5344c27200eb6d484fabad8149ee050281715023 100644 --- a/conf/nebula-graphd.conf.default +++ b/conf/nebula-graphd.conf.default @@ -36,8 +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 to process request and return response. +# The number of networking IO threads --num_netio_threads=1 +# The number of threads to execute user queries +--num_worker_threads=1 # HTTP service port --ws_http_port=13000 # HTTP2 service port diff --git a/src/daemons/GraphDaemon.cpp b/src/daemons/GraphDaemon.cpp index c55081524192ac9ac5b9870c19851ebcb86a74dd..34b688bd260b322975dfb492798817b36e18494d 100644 --- a/src/daemons/GraphDaemon.cpp +++ b/src/daemons/GraphDaemon.cpp @@ -122,7 +122,7 @@ int main(int argc, char *argv[]) { gServer->setIdleTimeout(std::chrono::seconds(FLAGS_client_idle_timeout_secs)); // TODO(dutor) This only take effects on NORMAL priority threads - gServer->setNumCPUWorkerThreads(1); + gServer->setNumCPUWorkerThreads(FLAGS_num_worker_threads); gServer->setCPUWorkerThreadName("executor"); gServer->setNumAcceptThreads(FLAGS_num_accept_threads); diff --git a/src/executor/GraphFlags.cpp b/src/executor/GraphFlags.cpp index e951faf01522d4e0d7c84d1d38d11102c3c4be6c..a9d2afbebe82ff146522fb9b7453deb931731c7e 100644 --- a/src/executor/GraphFlags.cpp +++ b/src/executor/GraphFlags.cpp @@ -16,6 +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_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"); diff --git a/src/executor/GraphFlags.h b/src/executor/GraphFlags.h index ebd10f4ca03aced1d6e5302451fd350135720994..446213f56cac32c592d71d7fef9eacb13a1f9c58 100644 --- a/src/executor/GraphFlags.h +++ b/src/executor/GraphFlags.h @@ -15,6 +15,7 @@ DECLARE_int32(session_idle_timeout_secs); DECLARE_int32(session_reclaim_interval_secs); DECLARE_int32(num_netio_threads); DECLARE_int32(num_accept_threads); +DECLARE_int32(num_worker_threads); DECLARE_bool(reuse_port); DECLARE_int32(listen_backlog); DECLARE_string(listen_netdev);