Skip to content

Commit 7f62d3b

Browse files
committed
Merge branch 'main' of github.com:johnramsden/OxCache
2 parents 7e8f5a2 + 25a45b0 commit 7f62d3b

File tree

8 files changed

+51
-48
lines changed

8 files changed

+51
-48
lines changed

cortes.server.block.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ log_level = "info"
33
[server]
44
socket = "/tmp/oxcache.sock"
55
disk = "/dev/nvme1n1"
6-
writer_threads = 14
7-
reader_threads = 14
6+
writer_threads = 64
7+
reader_threads = 64
88
chunk_size = 65536
99
block_zone_capacity = 1129316352
1010
max_write_size = 262144
@@ -24,4 +24,5 @@ eviction_interval_ms = 1000 # Evict every 1s
2424
[metrics]
2525
ip_addr = "127.0.0.1"
2626
port = 9000
27-
file_metrics_directory = "./logs"
27+
file_metrics_directory = "./logs"
28+
eviction_metrics = true

cortes.server.zns.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ log_level = "info"
33
[server]
44
socket = "/tmp/oxcache.sock"
55
disk = "/dev/nvme0n2"
6-
writer_threads = 14
7-
reader_threads = 14
6+
writer_threads = 64
7+
reader_threads = 64
88
chunk_size = 1048576
99
block_zone_capacity = 1129316352
1010
max_write_size = 262144
@@ -24,4 +24,5 @@ eviction_interval_ms = 1000 # Evict every 1s
2424
[metrics]
2525
ip_addr = "127.0.0.1"
2626
port = 9000
27-
file_metrics_directory = "./logs"
27+
file_metrics_directory = "./logs"
28+
eviction_metrics = true

oxcache/src/server.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,8 @@ async fn handle_connection<T: RemoteBackend + Send + Sync + 'static>(
459459
METRICS.update_metric_histogram_latency("get_hit_latency_ms", start.elapsed(), MetricType::MsLatency);
460460
METRICS.update_metric_counter("hit", 1);
461461
METRICS.update_hitratio(HitType::Hit);
462-
METRICS.update_metric_counter("written_bytes_total", chunk.size);
462+
METRICS.update_metric_counter("read_bytes_total", chunk.size);
463+
METRICS.update_metric_counter("bytes_total", chunk.size);
463464
tracing::debug!("REQ[{}] CACHE HIT completed successfully", request_id);
464465
Ok(())
465466
}
@@ -541,7 +542,8 @@ async fn handle_connection<T: RemoteBackend + Send + Sync + 'static>(
541542
METRICS.update_metric_counter("miss", 1);
542543
METRICS.update_metric_histogram_latency("get_miss_latency_ms", start.elapsed(), MetricType::MsLatency);
543544
METRICS.update_hitratio(HitType::Miss);
544-
METRICS.update_metric_counter("read_bytes_total", chunk_size);
545+
METRICS.update_metric_counter("written_bytes_total", chunk_size);
546+
METRICS.update_metric_counter("bytes_total", chunk_size);
545547
tracing::debug!("REQ[{}] CACHE MISS completed successfully", request_id);
546548
Ok(write_response)
547549
}
@@ -551,7 +553,6 @@ async fn handle_connection<T: RemoteBackend + Send + Sync + 'static>(
551553
std::io::Error::new(std::io::ErrorKind::Other, format!("cache.get_or_insert_with failed: {}", e))
552554
})?;
553555
tracing::debug!("REQ[{}] Request completed successfully", request_id);
554-
METRICS.update_metric_counter("bytes_total", chunk_size);
555556
}
556557
request::Request::Close => {
557558
tracing::debug!("Received close request");

scripts/run_cpu_bench.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
set -e
55

6+
ulimit -n 65535
7+
68
# Get the directory in which this script is located:
79
SCRIPT_DIR="$(cd "$(dirname "$0")" || exit 1; pwd)"
810

scripts/run_cpu_bench_spc.sh

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,40 +8,36 @@ ulimit -n 65535
88
# Get the directory in which this script is located:
99
SCRIPT_DIR="$(cd "$(dirname "$0")" || exit 1; pwd)"
1010

11-
# Source workloads
12-
. "${SCRIPT_DIR}/spcconfigspace.sh"
13-
1411
# Cleanup function to kill server if it's running
1512
cleanup() {
1613
if [ -n "$SERVER_PID" ] && kill -0 "$SERVER_PID" 2>/dev/null; then
1714
echo "Cleaning up server PID $SERVER_PID"
1815
kill "$SERVER_PID"
1916
wait "$SERVER_PID" 2>/dev/null || true
2017
fi
21-
# if [ -n "$PIDSTAT_PID" ] && kill -0 "$PIDSTAT_PID" 2>/dev/null; then
22-
# echo "Cleaning up pidstat PID $PIDSTAT_PID"
23-
# kill "$PIDSTAT_PID"
24-
# wait "$PIDSTAT_PID" 2>/dev/null || true
25-
# fi
2618
}
2719

2820
# Set trap to cleanup on script exit
2921
trap cleanup EXIT INT TERM
3022

3123
usage() {
32-
printf "Usage: %s TRACE CONFIGFILE DEVICE\n" "$(basename "$0")"
24+
printf "Usage: %s TRACE SPCCONFIGSPACE CONFIGFILE DEVICE\n" "$(basename "$0")"
3325
exit 1
3426
}
3527

3628
# Check that exactly 4 positional arguments remain
37-
if [ "$#" -ne 3 ]; then
38-
echo "Illegal number of parameters $#, should be 2"
29+
if [ "$#" -ne 4 ]; then
30+
echo "Illegal number of parameters $#, should be 3"
3931
usage
4032
fi
4133

4234
trace="$(realpath "$1")"
4335
configfile="$2"
44-
device="$3"
36+
spcconfigspace="$3"
37+
device="$4"
38+
39+
# Source workloads
40+
. "${spcconfigspace}"
4541

4642
echo "Logging to: ./logs"
4743
echo "Configfile: $configfile"
@@ -70,17 +66,13 @@ for tracecfg in "${workloads[@]}"; do
7066
declare -g "$key"="$value"
7167
done
7268

73-
runfile="./logs/$chunk_size,L=$latency,$distr,R=$ratio,I=$iterations,NZ=$n_zones,$eviction,${device##*/}-$(date '+%d_%H:%M:%S')-run"
69+
runfile="./logs/$chunk_size,L=$latency,NZ=$n_zones,$eviction,${device##*/}-$(date '+%d_%H:%M:%S')-run"
7470
# Now you can access the variables
7571
{
7672
echo "Chunk Size: $chunk_size"
7773
echo "Latency: $latency"
78-
echo "Distribution Type: $distr"
79-
echo "Working Set Ratio: $ratio"
8074
echo "Zone Size: $zone_size"
81-
echo "Iterations: $iterations"
8275
echo "Number of Zones: $n_zones"
83-
echo "Total Chunks: $chunks"
8476
echo "High Water: $evict_high"
8577
echo "Low water: $evict_low"
8678
echo "Eviction $eviction"
@@ -165,11 +157,15 @@ for tracecfg in "${workloads[@]}"; do
165157
tail -n3 "$runfile.client"
166158
fi
167159

168-
sleep 10s
169-
170-
# tar -czf "./logs-compressed/$(basename "$runfile.tar.gz")" ./logs
171-
# rm -rf ./logs/*
160+
tar -czf "./logs-compressed/$(basename "$runfile.tar.gz")" ./logs
161+
rm -rf ./logs/*
172162

173163
done
174164

165+
logsdir="./logs-compressed-$(date '+%d_%H:%M:%S')"
166+
167+
mkdir -p "${logsdir}"
168+
169+
mv ./logs-compressed/* "${logsdir}"
170+
175171
exit $ret

scripts/spcconfigspace.block.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
# BLOCK
4+
workloads=(
5+
'chunk_size=1129316352,latency=5413781,evict_high=2,evict_low=3,eviction=promotional,n_zones=904,t=64,zone_size=1129316352'
6+
'chunk_size=268435456,latency=3209583,evict_high=2,evict_low=6,eviction=promotional,n_zones=904,t=256,zone_size=1129316352'
7+
'chunk_size=268435456,latency=3209583,evict_high=5,evict_low=37,eviction=chunk,n_zones=904,t=256,clean_low=0,zone_size=1129316352'
8+
'chunk_size=65536,latency=40632,evict_high=17233,evict_low=86161,eviction=chunk,n_zones=904,t=1024,clean_low=0,zone_size=1129316352'
9+
'chunk_size=65536,latency=40632,evict_high=5,evict_low=9,eviction=promotional,n_zones=904,t=1024,zone_size=1129316352'
10+
)

scripts/spcconfigspace.sh

Lines changed: 0 additions & 18 deletions
This file was deleted.

scripts/spcconfigspace.zns.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
# ZONED
4+
workloads=(
5+
'chunk_size=1129316352,latency=5413781,evict_high=9,evict_low=13,eviction=promotional,n_zones=904,t=64,zone_size=1129316352'
6+
'chunk_size=268435456,latency=3209583,evict_high=5,evict_low=37,eviction=chunk,n_zones=904,t=256,clean_low=24,zone_size=1129316352'
7+
'chunk_size=268435456,latency=3209583,evict_high=9,evict_low=17,eviction=promotional,n_zones=904,t=256,zone_size=1129316352'
8+
'chunk_size=65536,latency=40632,evict_high=2,evict_low=10,eviction=promotional,n_zones=904,t=1024,zone_size=1129316352'
9+
'chunk_size=65536,latency=40632,evict_high=68929,evict_low=206785,eviction=chunk,n_zones=904,t=1024,clean_low=68928,zone_size=1129316352'
10+
)

0 commit comments

Comments
 (0)