aboutsummaryrefslogtreecommitdiffstats
path: root/research/experiments/026-apps-on-one-host/runs.sh
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-10-01 06:25:21 +0100
committereunhhu <[email protected]>2026-10-01 06:25:21 +0100
commitddcc1202daa7de84f13ff712fdb5ad12159facc1 (patch)
tree47deddd3c047df16c3c94d8a2ea9f4724a852083 /research/experiments/026-apps-on-one-host/runs.sh
parentbe297ead16b41938e84bcc3f1be628bc8725f2f4 (diff)
downloadpure-ddcc1202daa7de84f13ff712fdb5ad12159facc1.tar.gz
pure-ddcc1202daa7de84f13ff712fdb5ad12159facc1.zip
Measure one host of many apps against a process each (111)
017's first stage met its four criteria on the Pi (RAM stores, five rounds, the order of the ways turned): app B's 99th percentile while app A is flooded by 64 connections is 168 us, half of two processes' 336 us; the two apps busy together write 146.1k a second against 146.2k, with the same 1.4 ms tail; an app costs a host 120 KiB of its own memory (a process: 1,311 KiB PSS) and 100 apps still run on three threads; a host of one app keeps its speed (TPC-C +1.2% at the median of six pairs, two of them interfered and kept; the bank's queries within 2.6%) and its instructions (+0.94% at most). On the way: apps hopped between workers each turn (fixed in db4ee9c), connections of one app spread over all connection threads made the host a third more expensive a request and its tail a kernel tick (fixed by home threads, d24881d), and the work budget's counting cost every table row 26 instructions (fixed in be297ea). The earlier runs are kept apart (db4ee9c's isolation, d24881d's pairs and counts, the interrupted first try).
Diffstat (limited to 'research/experiments/026-apps-on-one-host/runs.sh')
-rwxr-xr-xresearch/experiments/026-apps-on-one-host/runs.sh52
1 files changed, 52 insertions, 0 deletions
diff --git a/research/experiments/026-apps-on-one-host/runs.sh b/research/experiments/026-apps-on-one-host/runs.sh
new file mode 100755
index 0000000..f2ddf19
--- /dev/null
+++ b/research/experiments/026-apps-on-one-host/runs.sh
@@ -0,0 +1,52 @@
+#!/bin/sh
+# The runs of docs/design/017's first stage, from the repository's root, in
+# steps (each fits a session's background limit), the binaries kept in
+# $WORK (default /tmp/pure-026) between them:
+# runs.sh build pure-serve before 017 (0b5fa1d, in a scratch worktree) and after
+# runs.sh memory what an app costs a host (memory.py)
+# runs.sh isolation two apps as two processes or one host (isolation.py, five rounds of 15 s)
+# runs.sh pairs A B a host of one app before and after, rounds A to B in turns as 025 ran them:
+# TPC-C in RAM (W=1, 64 terminals) and the bank's queries
+# runs.sh counts the bank queries' instructions before and after (025's count.py)
+# Each timed step waits until the Pi has been quiet (the last minute's load below 1.5).
+set -e
+out=research/experiments/026-apps-on-one-host
+work=${WORK:-/tmp/pure-026}
+quiet() { until awk '{ exit !($1 < 1.5) }' /proc/loadavg; do sleep 10; done; }
+case $1 in
+build)
+ mkdir -p $work
+ git worktree add -q --detach $work/tree 0b5fa1d
+ make -C $work/tree -s build/pure-serve
+ cp $work/tree/build/pure-serve $work/pure-serve-before
+ git worktree remove --force $work/tree
+ make -s build/pure-serve
+ cp build/pure-serve $work/pure-serve-after
+ (cd benchmarks/http && cc -O2 -std=c17 -o load load.c) ;;
+memory)
+ quiet
+ python3 $out/memory.py $work/pure-serve-after 1 10 100 > $out/2026-10-01-memory-linux-aarch64.jsonl ;;
+isolation)
+ quiet
+ echo "isolation $(uptime)" >> $out/2026-10-01-load.txt
+ python3 $out/isolation.py $work/pure-serve-after 5 15 > $out/2026-10-01-isolation-linux-aarch64.jsonl ;;
+pairs)
+ for round in $(seq $2 $3); do
+ first=before second=after
+ if [ $((round % 2)) = 0 ]; then first=after second=before; fi
+ for version in $first $second; do
+ quiet
+ echo "$round $version $(uptime)" >> $out/2026-10-01-load.txt
+ python3 benchmarks/tpcc/run.py --serve $work/pure-serve-$version --warehouses 1 --check 0 --terminals 64 \
+ --sqlite-threads '' --sqlite-group '' --seconds 20 > $out/2026-10-01-tpcc-$version-$round-linux-aarch64.jsonl
+ python3 benchmarks/bank/queries.py --serve $work/pure-serve-$version \
+ > $out/2026-10-01-queries-$version-$round-linux-aarch64.jsonl
+ done
+ done ;;
+counts)
+ python3 research/experiments/025-i64-cost/count.py $work/pure-serve-before $work/pure-serve-after \
+ $work/pure-serve-before $work/pure-serve-after > $out/2026-10-01-counts-linux-aarch64.jsonl ;;
+*)
+ echo "runs.sh build|memory|isolation|pairs FIRST LAST|counts" >&2
+ exit 2 ;;
+esac