sunnyszy / lrb

A C++11 simulator for a variety of CDN caching policies.
BSD 2-Clause "Simplified" License
78 stars 28 forks source link

Unexpected behaviour of the simulator on sample trace #25

Open super-shayan opened 11 months ago

super-shayan commented 11 months ago

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
super-shayan commented 11 months ago

@sunnyszy could you please look into this? Thank you!

sunnyszy commented 11 months ago

Hi @super-shayan,

It may be because LHD code is directly ported and is not based on the simulator base code. Sorry it's been a while for me to remember clearer, and to verify you would need to inspect the code.