This is the implementation repository of 3L-CACHE: Low Overhead and Precise Learning-based Eviction Policy for Web Caches.
This artifact provides the source code of 3L-Cache and scripts to reproduce experiment results in our paper.
3L-Cache/ -- Forked from LibCacheSim, which is a platform for cache evaluation. For details, please visit LibCacheSim.
3L-Cache/3LCache -- Our 3L-Cache implementation. For details, please visit 3LCache.
Request traces are expected to be in a space-separated format with 3 columns.
| time | id | size |
|---|---|---|
| 1 | 1 | 120 |
| 2 | 2 | 64 |
| 3 | 2 | 64 |
We provide some scripts for installation.
cd scripts && bash install_dependency.sh && bash install_libcachesim.sh
After building and installing, cachesim should be in the _build/bin/ directory.
~/3L-Cache/_build/bin/cachesim trace_path trace_type eviction_algo cache_size [OPTION...]
| Dataset | Year | Type | Original Link |
|---|---|---|---|
| Tencent Photo | 2018 | object | link |
| WikiCDN | 2019 | object | link |
| WikiCDN 2018 | 2018 | object | link |
| WikiCDN 2019 | 2019 | object | link |
| Tencent CBS | 2020 | block | link |
| Alibaba Block | 2020 | block | link |
| 2020 | key-value | link | |
| MetaKV | 2022 | key-value | link |
| MetaCDN | 2023 | object | link |
/path/to/cachesim /path/to/tencentBlock_ns3964.csv csv 3lcache 1347453593 -t "time-col=1, obj-id-is-num=true, obj-id-col=2, obj-size-col=3"
/path/to/cachesim /path/to/tencentBlock_ns3964.csv csv 3lcache 1347453593,13474535 -t "time-col=1, obj-id-is-num=true, obj-id-col=2, obj-size-col=3"
# unzip a trace
unzip ~/3L-Cache/data/tencentBlock_ns3964.zip -d ~/3L-Cache/data/
~/3L-Cache/_build/bin/cachesim ~/3L-Cache/data/tencentBlock_ns3964.csv csv 3lcache-omr 1347453593 -t "time-col=1, obj-id-is-num=true, obj-id-col=2, obj-size-col=3"
# Output object miss ratio
tencentBlock_ns3964.csv TLCache-OMR cache size 1GiB, 13625211 req, miss ratio 0.3380, throughput 0.59 MQPS
~/3L-Cache/_build/bin/cachesim ~/3L-Cache/data/tencentBlock_ns3964.csv csv 3lcache 1347453593,13474535 -t "time-col=1, obj-id-is-num=true, obj-id-col=2, obj-size-col=3"
#Output object miss ratio and byte miss ratio
result/tencentBlock_ns3964.csv TLCache-BMR cache size 1GiB, 13625211 req, miss ratio 0.3421, byte miss ratio 0.1034
result/tencentBlock_ns3964.csv TLCache-BMR cache size 0GiB, 13625211 req, miss ratio 0.5300, byte miss ratio 0.6377
# <dataset_path> is the path of the traces, which can contain multiple traces; <dataset_info> records the number of unique bytes(the minimum cache size required to store the entire trace). It is composed of a dictionary, where the key represents the name of the trace and the value represents the number of unique bytes; <algo> is a list containing the caching strategies that need to be measured; <metric> only includes object miss ratio(omr) and byte miss ratio(bmr).
cd 3L-Cache/3LCache/scripts
# This command will retrieve the trace under <dataset-path> and conduct experiments to measure the miss ratio.
# The generated experimental results are kept in 3LCache/scripts/result, and corresponding boxplots are generated in the figures folder.
python3 miss_ratio_boxplot.py --dataset_path=<dataset_path> --dataset_info=<dataset_info> --algo=<eviction_algo> --metric=<metric>
# Example
python3 miss_ratio_boxplot.py --algo="['3lcache', 'lecar', 'lhd', 'sieve', 'cacheus', 'gdsf', 'tinylfu', 's3fifo', 'lru','arc']" --dataset_path="../../data/" --dataset_info="./trace_info/dataset_info.txt" --metric="bmr"
# This command will retrieve the trace under <dataset-path> and conduct experiments to measure the cpu overhead.
# The generated experimental results are kept in 3LCache/scripts/, and corresponding boxplots are generated in the figures folder.
python3 cpu_overhead_boxplot.py --dataset_path=<dataset_path> --dataset_info=<dataset_info> --algo=<eviction_algo>
# Example
python3 cpu_overhead_boxplot.py --algo="['3lcache', 'lecar', 'lhd', 'sieve', 'cacheus', 'gdsf', 'tinylfu', 's3fifo', 'lru','arc']" --dataset_path="../../data/" --dataset_info="./trace_info/dataset_info.txt"
# This script helps conduct experiments with sample traces directly to show the code is functional.
# The key figures (Figure 6, Figure 8, and 10) can be generated via this script with real traces or sample traces.
./run_scripts.sh
Download the traces(download datasets from the link).
Process the dataset according to the trace format(link) we provide.
Select traces with more than 10 million requests and put it in the data folder.
Count unique bytes of traces for setting cache size. Here, we provide unique bytes of some traces in the trace_info folder.
Execute the following command. This command will read traces under 3L-Cache/data, conduct experiments, and finally generate experimental result figures in the figures folder.
cd 3L-Cache/3LCache/scripts
./run_scripts.sh
C++
48.6%
C
28.5%
Python
15.5%
R
5.5%
CMake
1.4%
This is the implementation repository of 3L-CACHE: Low Overhead and Precise Learning-based Eviction Policy for Web Caches.
This artifact provides the source code of 3L-Cache and scripts to reproduce experiment results in our paper.
3L-Cache/ -- Forked from LibCacheSim, which is a platform for cache evaluation. For details, please visit LibCacheSim.
3L-Cache/3LCache -- Our 3L-Cache implementation. For details, please visit 3LCache.
Request traces are expected to be in a space-separated format with 3 columns.
| time | id | size |
|---|---|---|
| 1 | 1 | 120 |
| 2 | 2 | 64 |
| 3 | 2 | 64 |
We provide some scripts for installation.
cd scripts && bash install_dependency.sh && bash install_libcachesim.sh
After building and installing, cachesim should be in the _build/bin/ directory.
~/3L-Cache/_build/bin/cachesim trace_path trace_type eviction_algo cache_size [OPTION...]
| Dataset | Year | Type | Original Link |
|---|---|---|---|
| Tencent Photo | 2018 | object | link |
| WikiCDN | 2019 | object | link |
| WikiCDN 2018 | 2018 | object | link |
| WikiCDN 2019 | 2019 | object | link |
| Tencent CBS | 2020 | block | link |
| Alibaba Block | 2020 | block | link |
| 2020 | key-value | link | |
| MetaKV | 2022 | key-value | link |
| MetaCDN | 2023 | object | link |
/path/to/cachesim /path/to/tencentBlock_ns3964.csv csv 3lcache 1347453593 -t "time-col=1, obj-id-is-num=true, obj-id-col=2, obj-size-col=3"
/path/to/cachesim /path/to/tencentBlock_ns3964.csv csv 3lcache 1347453593,13474535 -t "time-col=1, obj-id-is-num=true, obj-id-col=2, obj-size-col=3"
# unzip a trace
unzip ~/3L-Cache/data/tencentBlock_ns3964.zip -d ~/3L-Cache/data/
~/3L-Cache/_build/bin/cachesim ~/3L-Cache/data/tencentBlock_ns3964.csv csv 3lcache-omr 1347453593 -t "time-col=1, obj-id-is-num=true, obj-id-col=2, obj-size-col=3"
# Output object miss ratio
tencentBlock_ns3964.csv TLCache-OMR cache size 1GiB, 13625211 req, miss ratio 0.3380, throughput 0.59 MQPS
~/3L-Cache/_build/bin/cachesim ~/3L-Cache/data/tencentBlock_ns3964.csv csv 3lcache 1347453593,13474535 -t "time-col=1, obj-id-is-num=true, obj-id-col=2, obj-size-col=3"
#Output object miss ratio and byte miss ratio
result/tencentBlock_ns3964.csv TLCache-BMR cache size 1GiB, 13625211 req, miss ratio 0.3421, byte miss ratio 0.1034
result/tencentBlock_ns3964.csv TLCache-BMR cache size 0GiB, 13625211 req, miss ratio 0.5300, byte miss ratio 0.6377
# <dataset_path> is the path of the traces, which can contain multiple traces; <dataset_info> records the number of unique bytes(the minimum cache size required to store the entire trace). It is composed of a dictionary, where the key represents the name of the trace and the value represents the number of unique bytes; <algo> is a list containing the caching strategies that need to be measured; <metric> only includes object miss ratio(omr) and byte miss ratio(bmr).
cd 3L-Cache/3LCache/scripts
# This command will retrieve the trace under <dataset-path> and conduct experiments to measure the miss ratio.
# The generated experimental results are kept in 3LCache/scripts/result, and corresponding boxplots are generated in the figures folder.
python3 miss_ratio_boxplot.py --dataset_path=<dataset_path> --dataset_info=<dataset_info> --algo=<eviction_algo> --metric=<metric>
# Example
python3 miss_ratio_boxplot.py --algo="['3lcache', 'lecar', 'lhd', 'sieve', 'cacheus', 'gdsf', 'tinylfu', 's3fifo', 'lru','arc']" --dataset_path="../../data/" --dataset_info="./trace_info/dataset_info.txt" --metric="bmr"
# This command will retrieve the trace under <dataset-path> and conduct experiments to measure the cpu overhead.
# The generated experimental results are kept in 3LCache/scripts/, and corresponding boxplots are generated in the figures folder.
python3 cpu_overhead_boxplot.py --dataset_path=<dataset_path> --dataset_info=<dataset_info> --algo=<eviction_algo>
# Example
python3 cpu_overhead_boxplot.py --algo="['3lcache', 'lecar', 'lhd', 'sieve', 'cacheus', 'gdsf', 'tinylfu', 's3fifo', 'lru','arc']" --dataset_path="../../data/" --dataset_info="./trace_info/dataset_info.txt"
# This script helps conduct experiments with sample traces directly to show the code is functional.
# The key figures (Figure 6, Figure 8, and 10) can be generated via this script with real traces or sample traces.
./run_scripts.sh
Download the traces(download datasets from the link).
Process the dataset according to the trace format(link) we provide.
Select traces with more than 10 million requests and put it in the data folder.
Count unique bytes of traces for setting cache size. Here, we provide unique bytes of some traces in the trace_info folder.
Execute the following command. This command will read traces under 3L-Cache/data, conduct experiments, and finally generate experimental result figures in the figures folder.
cd 3L-Cache/3LCache/scripts
./run_scripts.sh
C++
48.6%
C
28.5%
Python
15.5%
R
5.5%
CMake
1.4%