From 9d12dec23fcf59db619924ca3a7c9b4dcc43d05b Mon Sep 17 00:00:00 2001 From: tangyanzhao Date: Fri, 16 Jul 2021 17:30:41 +0800 Subject: [PATCH 1/4] feat: split read request thread pool --- rdsn | 2 +- src/include/rrdb/rrdb.code.definition.h | 10 +++++----- src/server/config.ini | 8 +++++++- src/server/config.min.ini | 6 +++++- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/rdsn b/rdsn index 1275b1bfe8..8753610a74 160000 --- a/rdsn +++ b/rdsn @@ -1 +1 @@ -Subproject commit 1275b1bfe886289900f29a7091f6697257a11a6f +Subproject commit 8753610a74b2f51e3d58eedca8e19d89fb5c09e5 diff --git a/src/include/rrdb/rrdb.code.definition.h b/src/include/rrdb/rrdb.code.definition.h index a55dc1c92e..58c5962e9f 100644 --- a/src/include/rrdb/rrdb.code.definition.h +++ b/src/include/rrdb/rrdb.code.definition.h @@ -31,11 +31,11 @@ DEFINE_STORAGE_WRITE_RPC_CODE(RPC_RRDB_RRDB_CHECK_AND_SET, NOT_ALLOW_BATCH, NOT_ DEFINE_STORAGE_WRITE_RPC_CODE(RPC_RRDB_RRDB_CHECK_AND_MUTATE, NOT_ALLOW_BATCH, NOT_IDEMPOTENT) DEFINE_STORAGE_WRITE_RPC_CODE(RPC_RRDB_RRDB_DUPLICATE, NOT_ALLOW_BATCH, IS_IDEMPOTENT) DEFINE_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_GET) -DEFINE_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_MULTI_GET) -DEFINE_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_SORTKEY_COUNT) DEFINE_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_TTL) -DEFINE_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_GET_SCANNER) -DEFINE_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_SCAN) -DEFINE_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_CLEAR_SCANNER) +DEFINE_SCAN_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_SORTKEY_COUNT) +DEFINE_SCAN_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_GET_SCANNER) +DEFINE_SCAN_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_SCAN) +DEFINE_SCAN_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_CLEAR_SCANNER) +DEFINE_SCAN_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_MULTI_GET) } } diff --git a/src/server/config.ini b/src/server/config.ini index 4b52ffd0b6..ab7313858c 100644 --- a/src/server/config.ini +++ b/src/server/config.ini @@ -16,7 +16,7 @@ name = replica arguments = ports = 34801 - pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP,THREAD_POOL_BLOCK_SERVICE,THREAD_POOL_COMPACT,THREAD_POOL_INGESTION,THREAD_POOL_SLOG,THREAD_POOL_PLOG + pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP,THREAD_POOL_BLOCK_SERVICE,THREAD_POOL_COMPACT,THREAD_POOL_INGESTION,THREAD_POOL_SLOG,THREAD_POOL_PLOG,THREAD_SLOW_QUERY run = true count = 1 @@ -124,6 +124,12 @@ worker_priority = THREAD_xPRIORITY_NORMAL worker_count = 24 +[threadpool.THREAD_SLOW_QUERY] + name = slow_query + partitioned = false + worker_priority = THREAD_xPRIORITY_NORMAL + worker_count = 24 + [threadpool.THREAD_POOL_REPLICATION_LONG] name = rep_long partitioned = false diff --git a/src/server/config.min.ini b/src/server/config.min.ini index d7bd9085aa..22a454f612 100644 --- a/src/server/config.min.ini +++ b/src/server/config.min.ini @@ -12,7 +12,7 @@ type = replica name = replica ports = @REPLICA_PORT@ - pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP,THREAD_POOL_BLOCK_SERVICE,THREAD_POOL_COMPACT,THREAD_POOL_INGESTION,THREAD_POOL_SLOG,THREAD_POOL_PLOG + pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP,THREAD_POOL_BLOCK_SERVICE,THREAD_POOL_COMPACT,THREAD_POOL_INGESTION,THREAD_POOL_SLOG,THREAD_POOL_PLOG,THREAD_SLOW_QUERY [apps.collector] name = collector @@ -72,6 +72,10 @@ name = local_app worker_count = 2 +[threadpool.THREAD_SLOW_QUERY] + name = slow_query + worker_count = 2 + [threadpool.THREAD_POOL_REPLICATION_LONG] name = rep_long worker_count = 2 From b15d001d0992e9c24996de0f64c9d4dc74bd7d3b Mon Sep 17 00:00:00 2001 From: tangyanzhao Date: Fri, 16 Jul 2021 17:36:10 +0800 Subject: [PATCH 2/4] format --- rdsn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rdsn b/rdsn index 8753610a74..e31d49ca6d 160000 --- a/rdsn +++ b/rdsn @@ -1 +1 @@ -Subproject commit 8753610a74b2f51e3d58eedca8e19d89fb5c09e5 +Subproject commit e31d49ca6d98dba7b83b272cae0346edf6026337 From 168957d27f632559b57de1a29bd01d4b6648a842 Mon Sep 17 00:00:00 2001 From: tangyanzhao Date: Thu, 12 Aug 2021 19:20:59 +0800 Subject: [PATCH 3/4] change name --- rdsn | 2 +- src/include/rrdb/rrdb.code.definition.h | 10 +++++----- src/server/config.ini | 4 ++-- src/server/config.min.ini | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/rdsn b/rdsn index e31d49ca6d..2b7cbf5294 160000 --- a/rdsn +++ b/rdsn @@ -1 +1 @@ -Subproject commit e31d49ca6d98dba7b83b272cae0346edf6026337 +Subproject commit 2b7cbf5294fbfd05b0b3eda68a60292916cb6370 diff --git a/src/include/rrdb/rrdb.code.definition.h b/src/include/rrdb/rrdb.code.definition.h index 58c5962e9f..f9cfb544c4 100644 --- a/src/include/rrdb/rrdb.code.definition.h +++ b/src/include/rrdb/rrdb.code.definition.h @@ -32,10 +32,10 @@ DEFINE_STORAGE_WRITE_RPC_CODE(RPC_RRDB_RRDB_CHECK_AND_MUTATE, NOT_ALLOW_BATCH, N DEFINE_STORAGE_WRITE_RPC_CODE(RPC_RRDB_RRDB_DUPLICATE, NOT_ALLOW_BATCH, IS_IDEMPOTENT) DEFINE_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_GET) DEFINE_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_TTL) -DEFINE_SCAN_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_SORTKEY_COUNT) -DEFINE_SCAN_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_GET_SCANNER) -DEFINE_SCAN_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_SCAN) -DEFINE_SCAN_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_CLEAR_SCANNER) -DEFINE_SCAN_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_MULTI_GET) +DEFINE_STORAGE_SCAN_RPC_CODE(RPC_RRDB_RRDB_SORTKEY_COUNT) +DEFINE_STORAGE_SCAN_RPC_CODE(RPC_RRDB_RRDB_GET_SCANNER) +DEFINE_STORAGE_SCAN_RPC_CODE(RPC_RRDB_RRDB_SCAN) +DEFINE_STORAGE_SCAN_RPC_CODE(RPC_RRDB_RRDB_CLEAR_SCANNER) +DEFINE_STORAGE_SCAN_RPC_CODE(RPC_RRDB_RRDB_MULTI_GET) } } diff --git a/src/server/config.ini b/src/server/config.ini index ab7313858c..17c231d26e 100644 --- a/src/server/config.ini +++ b/src/server/config.ini @@ -16,7 +16,7 @@ name = replica arguments = ports = 34801 - pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP,THREAD_POOL_BLOCK_SERVICE,THREAD_POOL_COMPACT,THREAD_POOL_INGESTION,THREAD_POOL_SLOG,THREAD_POOL_PLOG,THREAD_SLOW_QUERY + pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP,THREAD_POOL_BLOCK_SERVICE,THREAD_POOL_COMPACT,THREAD_POOL_INGESTION,THREAD_POOL_SLOG,THREAD_POOL_PLOG,THREAD_POOL_SCAN run = true count = 1 @@ -124,7 +124,7 @@ worker_priority = THREAD_xPRIORITY_NORMAL worker_count = 24 -[threadpool.THREAD_SLOW_QUERY] +[threadpool.THREAD_POOL_SCAN] name = slow_query partitioned = false worker_priority = THREAD_xPRIORITY_NORMAL diff --git a/src/server/config.min.ini b/src/server/config.min.ini index 22a454f612..daa0d436dc 100644 --- a/src/server/config.min.ini +++ b/src/server/config.min.ini @@ -12,7 +12,7 @@ type = replica name = replica ports = @REPLICA_PORT@ - pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP,THREAD_POOL_BLOCK_SERVICE,THREAD_POOL_COMPACT,THREAD_POOL_INGESTION,THREAD_POOL_SLOG,THREAD_POOL_PLOG,THREAD_SLOW_QUERY + pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP,THREAD_POOL_BLOCK_SERVICE,THREAD_POOL_COMPACT,THREAD_POOL_INGESTION,THREAD_POOL_SLOG,THREAD_POOL_PLOG,THREAD_POOL_SCAN [apps.collector] name = collector @@ -72,7 +72,7 @@ name = local_app worker_count = 2 -[threadpool.THREAD_SLOW_QUERY] +[threadpool.THREAD_POOL_SCAN] name = slow_query worker_count = 2 From a380343d845e361365492002e238b012a58fac0a Mon Sep 17 00:00:00 2001 From: tangyanzhao Date: Thu, 12 Aug 2021 19:43:32 +0800 Subject: [PATCH 4/4] change name --- src/server/config.ini | 2 +- src/server/config.min.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/config.ini b/src/server/config.ini index 39aa9b23d9..0f3ae3753c 100644 --- a/src/server/config.ini +++ b/src/server/config.ini @@ -125,7 +125,7 @@ worker_count = 24 [threadpool.THREAD_POOL_SCAN] - name = slow_query + name = scan_query partitioned = false worker_priority = THREAD_xPRIORITY_NORMAL worker_count = 24 diff --git a/src/server/config.min.ini b/src/server/config.min.ini index daa0d436dc..ff74e651a1 100644 --- a/src/server/config.min.ini +++ b/src/server/config.min.ini @@ -73,7 +73,7 @@ worker_count = 2 [threadpool.THREAD_POOL_SCAN] - name = slow_query + name = scan_query worker_count = 2 [threadpool.THREAD_POOL_REPLICATION_LONG]