Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

perf(slog): Use a special thread pool for slog write callback #568

Merged
merged 6 commits into from
Jul 24, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion include/dsn/dist/replication/replication.codes.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ DEFINE_THREAD_POOL_CODE(THREAD_POOL_LOCAL_APP)
DEFINE_THREAD_POOL_CODE(THREAD_POOL_REPLICATION_LONG)
DEFINE_THREAD_POOL_CODE(THREAD_POOL_COMPACT)
DEFINE_THREAD_POOL_CODE(THREAD_POOL_INGESTION)
DEFINE_THREAD_POOL_CODE(THREAD_POOL_SLOG)

#define DEFINE_STORAGE_WRITE_RPC_CODE(x, allow_batch, is_idempotent) \
DEFINE_STORAGE_RPC_CODE( \
Expand Down Expand Up @@ -65,7 +66,6 @@ MAKE_EVENT_CODE_AIO(LPC_AIO_TEST, TASK_PRIORITY_COMMON)
MAKE_EVENT_CODE_AIO(LPC_AIO_IMMEDIATE_CALLBACK, TASK_PRIORITY_COMMON)
MAKE_EVENT_CODE_AIO(LPC_WRITE_REPLICATION_LOG_COMMON, TASK_PRIORITY_HIGH)
MAKE_EVENT_CODE_AIO(LPC_WRITE_REPLICATION_LOG_PRIVATE, TASK_PRIORITY_HIGH)
MAKE_EVENT_CODE_AIO(LPC_WRITE_REPLICATION_LOG_SHARED, TASK_PRIORITY_HIGH)
MAKE_EVENT_CODE(LPC_QUERY_CONFIGURATION_ALL, TASK_PRIORITY_HIGH)
MAKE_EVENT_CODE(LPC_MEM_RELEASE, TASK_PRIORITY_COMMON)
MAKE_EVENT_CODE(LPC_CREATE_CHILD, TASK_PRIORITY_COMMON)
Expand Down Expand Up @@ -185,6 +185,10 @@ MAKE_EVENT_CODE(LPC_REPLICATION_LONG_COMMON, TASK_PRIORITY_COMMON)
MAKE_EVENT_CODE(LPC_REPLICATION_LONG_HIGH, TASK_PRIORITY_HIGH)
#undef CURRENT_THREAD_POOL

#define CURRENT_THREAD_POOL THREAD_POOL_SLOG
MAKE_EVENT_CODE_AIO(LPC_WRITE_REPLICATION_LOG_SHARED, TASK_PRIORITY_HIGH)
#undef CURRENT_THREAD_POOL

// bulk load ingestion request
namespace dsn {
namespace apps {
Expand Down
4 changes: 4 additions & 0 deletions src/replica/duplication/test/config-test.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ worker_count = 2
name = default
partitioned = false

[threadpool.THREAD_POOL_SLOG]
name = slog
worker_count = 1

[threadpool.THREAD_POOL_REPLICATION]
name = replica
partitioned = true
Expand Down
6 changes: 5 additions & 1 deletion src/replica/storage/simple_kv/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ arguments =
ports = 34801
run = true
count = 3
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP,THREAD_POOL_SLOG

[apps.client]
type = client
Expand Down Expand Up @@ -63,6 +63,10 @@ name = default
partitioned = false
worker_priority = THREAD_xPRIORITY_LOWEST

[threadpool.THREAD_POOL_SLOG]
name = slog
worker_count = 1

[threadpool.THREAD_POOL_REPLICATION]
name = replication
partitioned = true
Expand Down
6 changes: 5 additions & 1 deletion src/replica/storage/simple_kv/test/case-000.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ arguments =
ports = 34801
run = true
count = 3
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP,THREAD_POOL_SLOG

[apps.c]
type = client
Expand Down Expand Up @@ -70,6 +70,10 @@ worker_priority = THREAD_xPRIORITY_LOWEST
partitioned = false
worker_priority = THREAD_xPRIORITY_LOWEST

[threadpool.THREAD_POOL_SLOG]
name = slog
worker_count = 1

[threadpool.THREAD_POOL_REPLICATION]
partitioned = true
worker_priority = THREAD_xPRIORITY_LOWEST
Expand Down
6 changes: 5 additions & 1 deletion src/replica/storage/simple_kv/test/case-001.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ arguments =
ports = 34801
run = true
count = 3
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP,THREAD_POOL_SLOG

[apps.c]
type = client
Expand Down Expand Up @@ -70,6 +70,10 @@ worker_priority = THREAD_xPRIORITY_LOWEST
partitioned = false
worker_priority = THREAD_xPRIORITY_LOWEST

[threadpool.THREAD_POOL_SLOG]
name = slog
worker_count = 1

[threadpool.THREAD_POOL_REPLICATION]
partitioned = true
worker_priority = THREAD_xPRIORITY_LOWEST
Expand Down
6 changes: 5 additions & 1 deletion src/replica/storage/simple_kv/test/case-002.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ arguments =
ports = 34801
run = true
count = 3
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP,THREAD_POOL_SLOG

[apps.c]
type = client
Expand Down Expand Up @@ -70,6 +70,10 @@ worker_priority = THREAD_xPRIORITY_LOWEST
partitioned = false
worker_priority = THREAD_xPRIORITY_LOWEST

[threadpool.THREAD_POOL_SLOG]
name = slog
worker_count = 1

[threadpool.THREAD_POOL_REPLICATION]
partitioned = true
worker_priority = THREAD_xPRIORITY_LOWEST
Expand Down
6 changes: 5 additions & 1 deletion src/replica/storage/simple_kv/test/case-003.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ arguments =
ports = 34801
run = true
count = 3
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP,THREAD_POOL_SLOG

[apps.c]
type = client
Expand Down Expand Up @@ -70,6 +70,10 @@ worker_priority = THREAD_xPRIORITY_LOWEST
partitioned = false
worker_priority = THREAD_xPRIORITY_LOWEST

[threadpool.THREAD_POOL_SLOG]
name = slog
worker_count = 1

[threadpool.THREAD_POOL_REPLICATION]
partitioned = true
worker_priority = THREAD_xPRIORITY_LOWEST
Expand Down
6 changes: 5 additions & 1 deletion src/replica/storage/simple_kv/test/case-004.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ arguments =
ports = 34801
run = true
count = 3
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP,THREAD_POOL_SLOG

[apps.c]
type = client
Expand Down Expand Up @@ -70,6 +70,10 @@ worker_priority = THREAD_xPRIORITY_LOWEST
partitioned = false
worker_priority = THREAD_xPRIORITY_LOWEST

[threadpool.THREAD_POOL_SLOG]
name = slog
worker_count = 1

[threadpool.THREAD_POOL_REPLICATION]
partitioned = true
worker_priority = THREAD_xPRIORITY_LOWEST
Expand Down
6 changes: 5 additions & 1 deletion src/replica/storage/simple_kv/test/case-005.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ arguments =
ports = 34801
run = true
count = 3
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP,THREAD_POOL_SLOG

[apps.c]
type = client
Expand Down Expand Up @@ -70,6 +70,10 @@ worker_priority = THREAD_xPRIORITY_LOWEST
partitioned = false
worker_priority = THREAD_xPRIORITY_LOWEST

[threadpool.THREAD_POOL_SLOG]
name = slog
worker_count = 1

[threadpool.THREAD_POOL_REPLICATION]
partitioned = true
worker_priority = THREAD_xPRIORITY_LOWEST
Expand Down
6 changes: 5 additions & 1 deletion src/replica/storage/simple_kv/test/case-006.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ arguments =
ports = 34801
run = true
count = 3
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP,THREAD_POOL_SLOG

[apps.c]
type = client
Expand Down Expand Up @@ -71,6 +71,10 @@ worker_priority = THREAD_xPRIORITY_LOWEST
partitioned = false
worker_priority = THREAD_xPRIORITY_LOWEST

[threadpool.THREAD_POOL_SLOG]
name = slog
worker_count = 1

[threadpool.THREAD_POOL_REPLICATION]
partitioned = true
worker_priority = THREAD_xPRIORITY_LOWEST
Expand Down
6 changes: 5 additions & 1 deletion src/replica/storage/simple_kv/test/case-100.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ arguments =
ports = 34801
run = true
count = 3
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP,THREAD_POOL_SLOG

[apps.c]
type = client
Expand Down Expand Up @@ -71,6 +71,10 @@ worker_priority = THREAD_xPRIORITY_LOWEST
partitioned = false
worker_priority = THREAD_xPRIORITY_LOWEST

[threadpool.THREAD_POOL_SLOG]
name = slog
worker_count = 1

[threadpool.THREAD_POOL_REPLICATION]
partitioned = true
worker_priority = THREAD_xPRIORITY_LOWEST
Expand Down
6 changes: 5 additions & 1 deletion src/replica/storage/simple_kv/test/case-101.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ arguments =
ports = 34801
run = true
count = 3
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP,THREAD_POOL_SLOG

[apps.c]
type = client
Expand Down Expand Up @@ -71,6 +71,10 @@ worker_priority = THREAD_xPRIORITY_LOWEST
partitioned = false
worker_priority = THREAD_xPRIORITY_LOWEST

[threadpool.THREAD_POOL_SLOG]
name = slog
worker_count = 1

[threadpool.THREAD_POOL_REPLICATION]
partitioned = true
worker_priority = THREAD_xPRIORITY_LOWEST
Expand Down
6 changes: 5 additions & 1 deletion src/replica/storage/simple_kv/test/case-102.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ arguments =
ports = 34801
run = true
count = 3
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP,THREAD_POOL_SLOG

[apps.c]
type = client
Expand Down Expand Up @@ -71,6 +71,10 @@ worker_priority = THREAD_xPRIORITY_LOWEST
partitioned = false
worker_priority = THREAD_xPRIORITY_LOWEST

[threadpool.THREAD_POOL_SLOG]
name = slog
worker_count = 1

[threadpool.THREAD_POOL_REPLICATION]
partitioned = true
worker_priority = THREAD_xPRIORITY_LOWEST
Expand Down
6 changes: 5 additions & 1 deletion src/replica/storage/simple_kv/test/case-103.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ arguments =
ports = 34801
run = true
count = 3
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP,THREAD_POOL_SLOG

[apps.c]
type = client
Expand Down Expand Up @@ -71,6 +71,10 @@ worker_priority = THREAD_xPRIORITY_LOWEST
partitioned = false
worker_priority = THREAD_xPRIORITY_LOWEST

[threadpool.THREAD_POOL_SLOG]
name = slog
worker_count = 1

[threadpool.THREAD_POOL_REPLICATION]
partitioned = true
worker_priority = THREAD_xPRIORITY_LOWEST
Expand Down
6 changes: 5 additions & 1 deletion src/replica/storage/simple_kv/test/case-104.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ arguments =
ports = 34801
run = true
count = 3
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP,THREAD_POOL_SLOG

[apps.c]
type = client
Expand Down Expand Up @@ -71,6 +71,10 @@ worker_priority = THREAD_xPRIORITY_LOWEST
partitioned = false
worker_priority = THREAD_xPRIORITY_LOWEST

[threadpool.THREAD_POOL_SLOG]
name = slog
worker_count = 1

[threadpool.THREAD_POOL_REPLICATION]
partitioned = true
worker_priority = THREAD_xPRIORITY_LOWEST
Expand Down
6 changes: 5 additions & 1 deletion src/replica/storage/simple_kv/test/case-105.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ arguments =
ports = 34801
run = true
count = 3
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP,THREAD_POOL_SLOG

[apps.c]
type = client
Expand Down Expand Up @@ -71,6 +71,10 @@ worker_priority = THREAD_xPRIORITY_LOWEST
partitioned = false
worker_priority = THREAD_xPRIORITY_LOWEST

[threadpool.THREAD_POOL_SLOG]
name = slog
worker_count = 1

[threadpool.THREAD_POOL_REPLICATION]
partitioned = true
worker_priority = THREAD_xPRIORITY_LOWEST
Expand Down
6 changes: 5 additions & 1 deletion src/replica/storage/simple_kv/test/case-106.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ arguments =
ports = 34801
run = true
count = 3
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP,THREAD_POOL_SLOG

[apps.c]
type = client
Expand Down Expand Up @@ -71,6 +71,10 @@ worker_priority = THREAD_xPRIORITY_LOWEST
partitioned = false
worker_priority = THREAD_xPRIORITY_LOWEST

[threadpool.THREAD_POOL_SLOG]
name = slog
worker_count = 1

[threadpool.THREAD_POOL_REPLICATION]
partitioned = true
worker_priority = THREAD_xPRIORITY_LOWEST
Expand Down
6 changes: 5 additions & 1 deletion src/replica/storage/simple_kv/test/case-107.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ arguments =
ports = 34801
run = true
count = 3
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP,THREAD_POOL_SLOG

[apps.c]
type = client
Expand Down Expand Up @@ -71,6 +71,10 @@ worker_priority = THREAD_xPRIORITY_LOWEST
partitioned = false
worker_priority = THREAD_xPRIORITY_LOWEST

[threadpool.THREAD_POOL_SLOG]
name = slog
worker_count = 1

[threadpool.THREAD_POOL_REPLICATION]
partitioned = true
worker_priority = THREAD_xPRIORITY_LOWEST
Expand Down
6 changes: 5 additions & 1 deletion src/replica/storage/simple_kv/test/case-108.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ arguments =
ports = 34801
run = true
count = 3
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP,THREAD_POOL_SLOG

[apps.c]
type = client
Expand Down Expand Up @@ -71,6 +71,10 @@ worker_priority = THREAD_xPRIORITY_LOWEST
partitioned = false
worker_priority = THREAD_xPRIORITY_LOWEST

[threadpool.THREAD_POOL_SLOG]
name = slog
worker_count = 1

[threadpool.THREAD_POOL_REPLICATION]
partitioned = true
worker_priority = THREAD_xPRIORITY_LOWEST
Expand Down
6 changes: 5 additions & 1 deletion src/replica/storage/simple_kv/test/case-109.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ arguments =
ports = 34801
run = true
count = 3
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_FD,THREAD_POOL_LOCAL_APP,THREAD_POOL_SLOG

[apps.c]
type = client
Expand Down Expand Up @@ -71,6 +71,10 @@ worker_priority = THREAD_xPRIORITY_LOWEST
partitioned = false
worker_priority = THREAD_xPRIORITY_LOWEST

[threadpool.THREAD_POOL_SLOG]
name = slog
worker_count = 1

[threadpool.THREAD_POOL_REPLICATION]
partitioned = true
worker_priority = THREAD_xPRIORITY_LOWEST
Expand Down
Loading