落盘机制修改

This commit is contained in:
2026-03-06 11:54:30 +00:00
parent c4e9bedd0a
commit 2e6baf0efe
14 changed files with 1302 additions and 443 deletions

View File

@@ -54,11 +54,12 @@ set_config() {
local ptype="$1"
local alloc="$2"
local pdir="$3"
python3 - "$CONFIG_XML" "$ptype" "$alloc" "$pdir" "$KV_PORT" <<'PY'
local oplog_sync="$4"
python3 - "$CONFIG_XML" "$ptype" "$alloc" "$pdir" "$KV_PORT" "$oplog_sync" <<'PY'
import sys
import xml.etree.ElementTree as ET
path, ptype, alloc, pdir, kv_port = sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5]
path, ptype, alloc, pdir, kv_port, oplog_sync = sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5], sys.argv[6]
tree = ET.parse(path)
root = tree.getroot()
@@ -81,10 +82,13 @@ persistence = root.find("persistence")
if persistence is not None:
t = persistence.find("type")
d = persistence.find("dir")
osync = persistence.find("oplog_sync")
if t is not None:
t.text = ptype
if d is not None:
d.text = pdir
if osync is not None:
osync.text = oplog_sync
memory = root.find("memory")
if memory is not None:
@@ -277,6 +281,7 @@ run_kv_case() {
local strategy="$1"
local persistence="$2"
local alloc="$3"
local oplog_sync="$4"
local -a set_qps_list=() set_avg_list=() set_elapsed_list=()
local -a get_qps_list=() get_avg_list=() get_elapsed_list=()
@@ -289,7 +294,7 @@ run_kv_case() {
rm -rf "$pdir_abs"
mkdir -p "$pdir_abs"
set_config "$persistence" "$alloc" "$pdir_rel"
set_config "$persistence" "$alloc" "$pdir_rel" "$oplog_sync"
start_kv "${strategy}_r${round}"
local m qps avg elapsed
@@ -496,10 +501,12 @@ main() {
require_cmd redis-cli
ensure_binaries
run_kv_case "persist_mypool" "incremental" "mypool"
run_kv_case "nopersist_mypool" "none" "mypool"
run_kv_case "persist_malloc" "incremental" "malloc"
run_kv_case "nopersist_malloc" "none" "malloc"
run_kv_case "persist_mypool" "incremental" "mypool" "none"
run_kv_case "everysec_mypool" "incremental" "mypool" "every_sec"
run_kv_case "nopersist_mypool" "none" "mypool" "none"
run_kv_case "persist_malloc" "incremental" "malloc" "none"
run_kv_case "everysec_malloc" "incremental" "malloc" "every_sec"
run_kv_case "nopersist_malloc" "none" "malloc" "none"
run_redis_case "none" "none" 6381 "\"\"" "no" "everysec"
run_redis_case "rdb_default" "rdb_default" 6382 "900 1 300 10 60 10000" "no" "everysec"