Giter Club home page Giter Club logo

lrb's Issues

Unexpected behaviour of the simulator on sample trace

I get unexpected exceptions for sample trace shown below, normally the LHD algorithm should ignore the request that requires more memory than current cache size.

ubuntu@x:~/trace$ cat sample_trace.tr 
0 0 10
1 1 10000000
ubuntu@x:~/trace$ docker run -it -v /home/ubuntu/trace:/trace sunnyszy/webcachesim sample_trace.tr LHD 9
/opt/webcachesim/build/bin/webcachesim_cli sample_trace.tr LHD 9 
running sanity check on trace: /trace/sample_trace.tr
n_extra_fields: 0
n_req: 0
pass sanity check
unrecognized parameter: n_extra_fields
simulating
Request too big: 84 > 9

For other algorithms it works as expected:

ubuntu@x:~/trace$ docker run -it -v /home/ubuntu/trace:/trace sunnyszy/webcachesim sample_trace.tr LRU 9
/opt/webcachesim/build/bin/webcachesim_cli sample_trace.tr LRU 9 
running sanity check on trace: /trace/sample_trace.tr
n_extra_fields: 0
n_req: 0
pass sanity check
simulating

seq: 2
cache size: 0/9 (0)
delta t: 0
segment bmr: 1
rss: 11653120
{ "trace_file" : "sample_trace.tr", "cache_type" : "LRU", "cache_size" : "9", "no_warmup_byte_miss_ratio" : 1.0, "segment_byte_miss" : [ 10000010 ], "segment_byte_req" : [ 10000010 ], "segment_object_miss" : [ 2 ], "segment_object_req" : [ 2 ], "segment_rss" : [ 11653120 ], "segment_byte_in_cache" : [ 0 ], "real_time_segment_byte_miss" : [ 0, 10000010 ], "real_time_segment_byte_req" : [ 0, 10000010 ], "real_time_segment_object_miss" : [ 0, 2 ], "real_time_segment_object_req" : [ 0, 2 ], "real_time_segment_rss" : [ 11653120, 11653120 ], "simulation_time" : "0", "simulation_timestamp" : "2023-11-30 19:55:29" }
warning: db connection failed: an invalid MongoDB URI was provided

Training LRB on non-CDN data

I want to get some information on the ML model itself and I am not sure if it's in this repo. I am looking to train it on my specific dataset unrelated to CDN. I am not quite sure if the extra_features column allows me flexibility or if there is somewhere else I should look.

Any information would be helpful and thanks so much!

fail sanity check

Hi, I would like to ask when I run the docker, n_req stops at 658000000 and the command lines show these:
"req: 658361220, key: 2334 size inconsistent. Old size: 356 new size: 35
terminate called after throwing an instance of 'std::runtime_error'
what(): fail sanity check"
Would you please tell me the reason, I'm a green hand at this and sorry to bother you!

Final json string is not printed for LeCaR

Hi,
When I was trying to run LeCaR, for example, by using this command sudo docker run -it -v ~/lrb/trace:/trace sunnyszy/webcachesim wiki2018.tr LeCaR 549755813888 > wiki18_LeCaR_512GB.txt, in the txt I did not see the final result json string printed. Instead I just have
image
And it got stuck there. I was wondering why this would happen?

something wrong with mongodb

Hello , I met a problem recently.
when i run " docker run --network="host" -it -v /home:/trace sunnyszy/webcachesim wiki2018.tr LRU 1099511627776 --dburi=mongodb://localhost:27017/cachebase "
there is something wrong
fd0bf176090246828fb34f9fb20f39d
warning: db connection failed: Invalid namespace specified 'cachebase.': generic server error

having size cache of zero

Hey, I wonder why I get at every run of the simulator that the cache size is zero?
I'm getting the following line:
cache size: 0/1099511627776 (0)
Do you have an idea why is it happens?

Wiki trace format

Hi, I was wondering whether the object's size in the wiki18 trace is in bytes or kilobytes?
Thanks.

Reporting Good Decision Ratio

Hi!

I was wondering if there was an easy way of reporting the good decision ratio. I see that the existing behavior already reports byte miss ratio, and was wondering how hard it would be to also report the good decision ratio, and any guidance/pointers to particular files to look at to do so. Also, is segment_window or real_time_segment_window the Belady boundary? How would I change that parameter when running LRB on a trace?

Much thanks!
-Kyle

LRB window tuning

Hi, I was trying to tune the LRB window for a new trace, but I'm not sure whether I'm doing it correctly. I use the command below

python3 lrb_window_search.py ~/job_dev.yaml ~/algorithm_params.yaml ~/trace_params.yaml mongodb://127.0.0.1:27017/mydb?compressors=disabled&gssapiServiceName=mongodb

And I got output in terminal as

2021-04-09 10:41:12.005 | INFO     | __main__:get_cache_size_and_parameter_list:158 - cdn1_500m_sigmetrics18.tr LRB ignore config: memory_window=10000000
2021-04-09 10:41:12.005 | INFO     | __main__:get_cache_size_and_parameter_list:165 - cdn1_500m_sigmetrics18.tr LRB ignore config: n_early_stop=[-1]
/mnt/data/miniconda3/lib/python3.8/site-packages/pymongo/compression_support.py:55: UserWarning: Unsupported compressor: disabled
  warnings.warn("Unsupported compressor: %s" % (compressor,))
lrb_window_search.py:38: UserWarning: no byte_million_req info, estimate memory window lower bound as 4k
  warnings.warn("no byte_million_req info, estimate memory window lower bound as 4k")
2021-04-09 10:41:12.011 | INFO     | __main__:get_validation_tasks_per_cache_size:54 - For cdn1_500m_sigmetrics18.tr/size=68719441552/LRB, memory windows to validate: [4095, 5622, 7718, 10594, 14543, 19963, 27404, 37617, 51637, 70883, 97301, 133565, 183345, 251678, 345479, 474239, 650989, 893613, 1226663, 1683842, 2311411, 3172875, 4355409, 5978673, 8206928, 11265657, 15464376, 21227960, 29139636, 40000000]
2021-04-09 10:41:12.012 | INFO     | __main__:get_cache_size_and_parameter_list:158 - cdn1_500m_sigmetrics18.tr LRB ignore config: memory_window=10000000
2021-04-09 10:41:12.012 | INFO     | __main__:get_cache_size_and_parameter_list:165 - cdn1_500m_sigmetrics18.tr LRB ignore config: n_early_stop=[-1]
2021-04-09 10:41:12.017 | INFO     | __main__:get_validation_tasks_per_cache_size:54 - For cdn1_500m_sigmetrics18.tr/size=137438883103/LRB, memory windows to validate: [4095, 5622, 7718, 10594, 14543, 19963, 27404, 37617, 51637, 70883, 97301, 133565, 183345, 251678, 345479, 474239, 650989, 893613, 1226663, 1683842, 2311411, 3172875, 4355409, 5978673, 8206928, 11265657, 15464376, 21227960, 29139636, 40000000]
2021-04-09 10:41:12.017 | INFO     | __main__:get_cache_size_and_parameter_list:158 - cdn1_500m_sigmetrics18.tr LRB ignore config: memory_window=10000000
2021-04-09 10:41:12.017 | INFO     | __main__:get_cache_size_and_parameter_list:165 - cdn1_500m_sigmetrics18.tr LRB ignore config: n_early_stop=[-1]
2021-04-09 10:41:12.022 | INFO     | __main__:get_validation_tasks_per_cache_size:54 - For cdn1_500m_sigmetrics18.tr/size=274877766207/LRB, memory windows to validate: [4095, 5622, 7718, 10594, 14543, 19963, 27404, 37617, 51637, 70883, 97301, 133565, 183345, 251678, 345479, 474239, 650989, 893613, 1226663, 1683842, 2311411, 3172875, 4355409, 5978673, 8206928, 11265657, 15464376, 21227960, 29139636, 40000000]
2021-04-09 10:41:12.023 | INFO     | __main__:get_cache_size_and_parameter_list:158 - cdn1_500m_sigmetrics18.tr LRB ignore config: memory_window=10000000
2021-04-09 10:41:12.023 | INFO     | __main__:get_cache_size_and_parameter_list:165 - cdn1_500m_sigmetrics18.tr LRB ignore config: n_early_stop=[-1]
2021-04-09 10:41:12.030 | INFO     | __main__:get_validation_tasks_per_cache_size:54 - For cdn1_500m_sigmetrics18.tr/size=549755532413/LRB, memory windows to validate: [4095, 5622, 7718, 10594, 14543, 19963, 27404, 37617, 51637, 70883, 97301, 133565, 183345, 251678, 345479, 474239, 650989, 893613, 1226663, 1683842, 2311411, 3172875, 4355409, 5978673, 8206928, 11265657, 15464376, 21227960, 29139636, 40000000]
2021-04-09 10:41:12.030 | INFO     | __main__:get_cache_size_and_parameter_list:158 - cdn1_500m_sigmetrics18.tr LRB ignore config: memory_window=10000000
2021-04-09 10:41:12.030 | INFO     | __main__:get_cache_size_and_parameter_list:165 - cdn1_500m_sigmetrics18.tr LRB ignore config: n_early_stop=[-1]
2021-04-09 10:41:12.037 | INFO     | __main__:get_validation_tasks_per_cache_size:54 - For cdn1_500m_sigmetrics18.tr/size=1099511064826/LRB, memory windows to validate: [4095, 5622, 7718, 10594, 14543, 19963, 27404, 37617, 51637, 70883, 97301, 133565, 183345, 251678, 345479, 474239, 650989, 893613, 1226663, 1683842, 2311411, 3172875, 4355409, 5978673, 8206928, 11265657, 15464376, 21227960, 29139636, 40000000]
n_task: 150
 generating job file to /tmp/1617982872.job
first task: bash --login -c "$WEBCACHESIM_ROOT/build/bin/webcachesim_cli cdn1_500m_sigmetrics18.tr LRB 274877766207 --dbcollection=dev --enable_trace_format_check=0 --segment_window=1000000 --real_time_segment_window=600 --uni_size=0 --is_metadata_in_cache_size=0 --dburi=mongodb://127.0.0.1:27017/mydb?compressors=disabled --sample_rate=64 --batch_size=131072 --max_n_past_timestamps=32 --num_iterations=32 --num_leaves=32 --num_threads=4 --learning_rate=0.1 --objective=byte_miss_ratio --n_edc_feature=10 --range_log=1000000 --version=opensource --n_req=500000000 --n_early_stop=100000000 --memory_window=893613 --task_id=1617982872040439" &> /tmp/1617982872040439.log

parallel -v --eta --shuf --sshdelay 0.1 -S 1/: < /tmp/1617982872.job
Academic tradition requires you to cite works you base your article on.
If you use programs that use GNU Parallel to process data for an article in a
scientific publication, please cite:

  Tange, O. (2021, March 22). GNU Parallel 20210322 ('2002-01-06').
  Zenodo. https://doi.org/10.5281/zenodo.4628277

This helps funding further development; AND IT WON'T COST YOU A CENT.
If you pay 10000 EUR you should feel free to use GNU Parallel without citing.

More about funding GNU Parallel and the citation notice:
https://www.gnu.org/software/parallel/parallel_design.html#Citation-notice

To silence this citation notice: run 'parallel --citation' once.


Computers / CPU cores / Max jobs to run
1:local / 1 / 1

Computer:jobs running/jobs completed/%of started jobs/Average seconds to complete
ETA: 0s Left: 150 AVG: 0.00s  local:1/0/100%/0.0s

And it just gets stuck there. I was wondering whether this gets running correctly? And how I am able to view the tuning result?

Calculate hit rate

Hi, thanks for open-sourcing this amazing project. In your paper you focus on the byte miss ratio, but I prefer to know the general hit rate.

So In the simulation.h, I added two counters inside the class Framework, as uint64_t cnt = 0, hit = 0;
And in the similation.cpp, in the simulate() function,
originally,
if (is_admitting) {
bool is_hit = webcache->lookup(*req);
if (!is_hit) {
update_metric_req(byte_miss, obj_miss, size);
update_metric_req(rt_byte_miss, rt_obj_miss, size)
webcache->admit(*req);
}
} else {
update_metric_req(byte_miss, obj_miss, size);
update_metric_req(rt_byte_miss, rt_obj_miss, size)
}
Now,
cnt++; //here!!!
if (is_admitting) {
bool is_hit = webcache->lookup(*req);
if (!is_hit) {
update_metric_req(byte_miss, obj_miss, size);
update_metric_req(rt_byte_miss, rt_obj_miss, size)
webcache->admit(*req);
} else {
hit++; //here!!!
}
} else {
update_metric_req(byte_miss, obj_miss, size);
update_metric_req(rt_byte_miss, rt_obj_miss, size)
}

And finally I use hit / cnt to get the hit rate. Is this correct? Thanks a lot!

How did you collect the Dataset?

Hi,

Thanks for you interesting work and making code and dataset available.

I just wanted to know where did you get the dataset? Did you collect it?
I appreciate it if you can give me some information.

LRB result not printed

Hi, I was using the cli to run wiki_18.tr trace, but I found out that LRB final result is not printed for 256 GB and it runs for a very long time now (other algorithms like below all finished)
image
Result folder:
image
Log folder (the last line of LRB log):
image
Is it still running or is there any problem that makes it stuck? When I run the 512 GB the tot seq is 2800000000.

How to set the value of Belady boundary?

In the paper of LRB, the Belady boundary is defined as the minimum time-to-next-request of objects evicted by Belady’s MIN algorithm. However, the MIN algorithm is offline, so it is reasonable to assume that the Belady boundary is approximately stationary and is updated continuously during the machine learning warmup period.

But in practice, Belady boundary is set to the length of sliding memory window which is equal to 67108864. I am confused whether the Belady boundary should be implicitly related to the cache capacity and the average size of cached objects.

Thank you and have a nice day!

Cache Size changes during simulation

Hi,

Thanks for sharing the code. I encountered an issue when running the program. Why does the cache size change during the simulation? The following is the output I got when I set the cache_size parameter to be 33554432, but from the second seq, the cache_size somehow increases to be very large.

seq: 1000000
cache size: 33491309/33554432 (0.998119)
delta t: 23.916
segment bmr: 0.814654
rss: 128008192
in/out metadata: 1273 / 72420
memory_window: 67108864
percent_beyond: 6.32882e-06
feature overhead per entry: 104
sample overhead per entry: 26
n_training: 41691
training_time: 192.614 ms
inference_time: 39.1755 us

seq: 2000000
cache size: 9462298711/18446744073615097856 (5.12952e-10)
delta t: 2.621
segment bmr: 0.268707
rss: 141557760
in/out metadata: 75467 / 30402
memory_window: 67108864
percent_beyond: 0
feature overhead per entry: 108
sample overhead per entry: 56
n_training: 62444
training_time: 249.561 ms
inference_time: 39.1755 us

seq: 3000000
cache size: 14666415799/18446744073601548288 (7.95068e-10)
delta t: 2.2
segment bmr: 0.124146
rss: 149803008
in/out metadata: 110383 / 21958
memory_window: 67108864
percent_beyond: 0
feature overhead per entry: 111
sample overhead per entry: 76
n_training: 59373
training_time: 281.636 ms
inference_time: 39.1755 us

.......

if I want run the algorithm as baseline

hello, Recently I've been doing research on access algorithms, I want to compare the performance of the LRB before adding the admit policy. Do I need to turn the bloom filter on to run the baseline?

Smaller Traces available?

Hi!

I am trying to work with this code and run it on my laptop, but the wikipedia traces are huge and given the compute used in the paper, I'm not sure if this is feasible or not. I had two questions about this:

  1. Are there any (much) smaller traces that are (a) available and (b) would work? (At least compared to the Wikipedia dataset, which is huge)
  2. Is it possible to adjust the cache parameters such that it would work feasibly on a laptop? Specifically an M2 MacbookAir or an x86 macbook.

Thanks! Any help is appreciated
-Kyle

a bug in LHD

There is a bug in LHD, because size is set after LHD initialization, LHD uses -1/INT64_MAX to initialize explorerBudget, which effectively becomes infinite.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.