ЛР 4 — БПИ2303 — Костылев — на 5 #162

Closed
akostylev2303 wants to merge 79 commits from akostylev2303/lab4 AGit into master
3 changed files with 15 additions and 10 deletions
Showing only changes of commit de9dc61ebc - Show all commits
+3 -1
View File
@@ -51,10 +51,12 @@ UPLOAD_SWEEP_BATCH=100
# Fixed glibc mmap threshold for the API: buffers above 128 KiB are returned to the system on free. # Fixed glibc mmap threshold for the API: buffers above 128 KiB are returned to the system on free.
MALLOC_MMAP_THRESHOLD_=131072 MALLOC_MMAP_THRESHOLD_=131072
# Solution-specific for lab4 track 2: limits of the one-off reconciler (profile reconcile), its S3 # Solution-specific for lab4 track 2: limits of the one-off reconciler (profile reconcile), its S3
# read timeout for listing pages, and optional CPU pinning of the measured services (empty = no pinning). # read timeout for listing pages, optional CPU pinning of the measured services (empty = no pinning)
# and the CPU limit of RustFS (make reconcile-cost raises it with its memory for 100k objects).
RECONCILE_CPUS=1 RECONCILE_CPUS=1
RECONCILE_MEMORY=256m RECONCILE_MEMORY=256m
RECONCILE_S3_READ_TIMEOUT_SECONDS=10 RECONCILE_S3_READ_TIMEOUT_SECONDS=10
RECONCILE_CPUSET= RECONCILE_CPUSET=
S3_CPUSET= S3_CPUSET=
PG_CPUSET= PG_CPUSET=
S3_CPUS=1
+1 -1
View File
@@ -222,7 +222,7 @@ services:
networks: [backend] networks: [backend]
deploy: deploy:
resources: resources:
limits: {cpus: "1", memory: "${S3_MEMORY:-512m}"} limits: {cpus: "${S3_CPUS:-1}", memory: "${S3_MEMORY:-512m}"}
reconciler: reconciler:
<<: *app <<: *app
+11 -8
View File
@@ -425,14 +425,15 @@ def demo(args):
def pins(args): def pins(args):
cpus = int(must(["docker", "info", "--format", "{{.NCPU}}"]).strip()) cpus = int(must(["docker", "info", "--format", "{{.NCPU}}"]).strip())
sized = {"S3_CPUS": "2", "S3_MEMORY": args.s3_memory}
if args.no_pin or cpus < 8: if args.no_pin or cpus < 8:
return {"S3_MEMORY": args.s3_memory} return sized
return { return dict(
"S3_CPUSET": str(cpus - 4), sized,
"PG_CPUSET": f"{cpus - 3}-{cpus - 2}", S3_CPUSET=f"{cpus - 5}-{cpus - 4}",
"RECONCILE_CPUSET": str(cpus - 1), PG_CPUSET=f"{cpus - 3}-{cpus - 2}",
"S3_MEMORY": args.s3_memory, RECONCILE_CPUSET=str(cpus - 1),
} )
def limits(): def limits():
@@ -462,6 +463,8 @@ def seed(count, env):
"/tools/seed_storage.py", "/tools/seed_storage.py",
"--count", "--count",
str(count), str(count),
"--concurrency",
"16",
env=env, env=env,
) )
return json.loads(out.strip().splitlines()[-1]) return json.loads(out.strip().splitlines()[-1])
@@ -578,7 +581,7 @@ def main():
k.add_argument("--deep-max", type=int, default=100000) k.add_argument("--deep-max", type=int, default=100000)
k.add_argument("--page-compare", type=int, default=10000) k.add_argument("--page-compare", type=int, default=10000)
k.add_argument("--settle", type=float, default=10) k.add_argument("--settle", type=float, default=10)
k.add_argument("--s3-memory", default="1g") k.add_argument("--s3-memory", default="3g")
k.add_argument("--no-pin", action="store_true") k.add_argument("--no-pin", action="store_true")
args = p.parse_args() args = p.parse_args()
if args.command == "demo": if args.command == "demo":