Skip to content

Commit 1c6afdb

Browse files
committed
MB-56673: Reduce dcp_{backfill,scan}_byte_limit defaults for serverless
At present serverless and on-prem profiles use the same default values for dcp_backfill_byte_limit and dcp_scan_byte_limit. However when running on serverless profiles we typically have much lower bucket quotas (e.g. 256MB), and hence allowing each DCP connection to backfill up to 20MB means backfill memory can quickly grow and reach the current threshold of backfill_mem_threshold - 96% of bucket quota; which is above the frontend mutation tmpOOM threshold (of 93%). Indeed in one test this lead to hardOOM errors being returned as memory spiked above bucket quota. While a more robust solution for DCP memory usage is being developed (see MB-46740), as a short-term tactical fix this patch reduces the defaults for serverless: * dcp_backfill_byte_limit is reduced from 20MB to 512kB. * dcp_scan_byte_limit is reduced from 4MB to 128kB. The updated default values for dcp_backfill_byte_limit on serverless is based on emperical evidence - we have seen DCP consumers (such as GSI) consume 160 MB of a 256 MB bucket when 2 GSI nodes are configured. Assuming up to 12 GSI nodes in a serverless cluster, that means GSI would create up to 48 connections. If we want to keep DCP memory below 10%, that means less than ~25MB of memory total across the 48 connections, which is approximately 0.5MB. dcp_scan_byte_limit is then set to a similar ratio of byte_limit as it was before (1/4). Change-Id: I1c8fdd14f6106af1ccc69e147fe2eb04be351219 Reviewed-on: https://review.couchbase.org/c/kv_engine/+/190290 Tested-by: Build Bot <[email protected]> Reviewed-by: Paolo Cocchi <[email protected]>
1 parent 034e2f2 commit 1c6afdb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

engines/ep/configuration.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,10 @@
975975
"type": "std::string"
976976
},
977977
"dcp_backfill_byte_limit": {
978-
"default": "20972856",
978+
"default": {
979+
"on-prem": "20 * 1024 * 1024",
980+
"serverless": "512 * 1024"
981+
},
979982
"descr": "Max bytes a connection can backfill into memory before backfill is paused",
980983
"dynamic": false,
981984
"type": "size_t"
@@ -1034,7 +1037,10 @@
10341037
}
10351038
},
10361039
"dcp_scan_byte_limit": {
1037-
"default": "4194304",
1040+
"default": {
1041+
"on-prem": "4 * 1024 * 1024",
1042+
"serverless": "128 * 1024"
1043+
},
10381044
"descr": "Max bytes that can be read in a single backfill scan before yielding",
10391045
"dynamic": false,
10401046
"type": "size_t"

0 commit comments

Comments
 (0)