Added simulation stop condition for maximum access count for the object with the highest lambda

Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
master
Tuan-Dat Tran 2024-11-13 16:46:36 +01:00
parent 8e1376cc44
commit 912b97a06e
3 changed files with 262 additions and 16602 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,100 +1,100 @@
,access_count,hits,misses,mu,lambda,hit_rate ,access_count,hits,misses,mu,lambda,hit_rate
1,63,57,6,5.399654088863246,1,90.91 1,338919,293278,45641,9.45073508577941,1,87.09
2,66,60,6,4.890335658893015,1,86.54 2,339569,295735,43834,8.14036449596436,1,87.19
3,52,45,7,4.375444630275031,1,93.75 3,339121,295683,43438,7.841130117448747,1,93.79
4,48,45,3,1.358965695760079,1,40.0 4,339726,318616,21110,2.2674748477937965,1,78.47
5,10,4,6,7.946779823996088,5,93.9 5,67728,53145,14583,1.9491614320948918,5,87.79
6,82,77,5,3.18260808979361,1,80.65 6,339470,298026,41444,6.571586635600101,1,77.43
7,31,25,6,5.605947602976087,2,66.67 7,170195,131783,38412,7.611334405003136,2,29.18
8,6,4,2,3.5941156596303507,21,91.67 8,16126,4705,11421,4.4496294204831255,21,88.2
9,72,66,6,3.8666443154519476,1,89.09 9,339776,299674,40102,5.998373656353862,1,87.76
10,55,49,6,3.9010358263416967,1,78.38 10,339314,297783,41531,6.636819845113485,1,77.12
11,37,29,8,3.956909570230068,2,93.62 11,170006,131110,38896,8.045921601779977,2,92.35
12,47,44,3,1.730567205003155,1,83.93 12,338799,312870,25929,2.811627158825997,1,87.45
13,56,47,9,5.904039737486446,1,92.06 13,338380,295915,42465,7.143615488470383,1,95.62
14,63,58,5,6.0088737342639815,1,79.31 14,339295,324424,14871,1.765483508758194,1,78.89
15,29,23,6,7.357737678743373,2,60.0 15,168900,133246,35654,5.959911292425263,2,41.86
16,5,3,2,1.450213741204231,9,37.5 16,37792,15821,21971,9.445879641550164,9,71.36
17,8,3,5,5.826606789353313,8,66.67 17,42276,30167,12109,1.835890334290284,8,73.65
18,15,10,5,9.95812133184028,3,77.78 18,113327,83461,29866,4.648600564543203,3,78.27
19,36,28,8,7.712014479036094,2,91.25 19,169939,133012,36927,6.632144547714242,2,96.59
20,80,73,7,4.633712335874409,1,81.4 20,339409,327834,11575,1.5219711334160873,1,86.89
21,43,35,8,7.911648101723665,1,82.05 21,339488,294970,44518,8.640804985015603,1,89.01
22,39,32,7,7.3654252444495425,1,92.54 22,338488,301286,37202,4.948940599763346,1,93.0
23,67,62,5,2.2670795468704905,1,85.19 23,339243,315511,23732,2.5215047387858385,1,93.5
24,54,46,8,8.134847295147168,1,94.92 24,338961,316939,22022,2.364507987541101,1,87.79
25,59,56,3,1.2117597080749123,1,80.77 25,338323,297005,41318,6.599461843110775,1,78.51
26,26,21,5,3.3524134464900266,2,91.67 26,169708,133242,36466,6.367528014392565,2,89.0
27,60,55,5,2.7158732876992437,1,87.88 27,339195,301871,37324,5.003687539185309,1,86.83
28,66,58,8,4.804077627549259,1,92.31 28,338836,294227,44609,8.69089847442159,1,89.4
29,65,60,5,4.2833971305094645,1,80.0 29,339057,303133,35924,4.636189613643649,1,79.99
30,35,28,7,9.583225049197923,2,91.8 30,169136,135290,33846,5.071027599242191,2,89.99
31,61,56,5,3.53247508842331,1,40.0 31,337940,304106,33834,4.08093995040424,1,23.8
32,5,2,3,9.558530824564308,25,72.73 32,13512,3216,10296,5.389385006998066,25,76.19
33,22,16,6,8.094454978234637,3,86.67 33,113049,86130,26919,3.6953335845304562,3,87.95
34,60,52,8,8.888543618416357,1,94.03 34,339556,298625,40931,6.455201262262219,1,88.24
35,67,63,4,2.453624754290659,1,76.19 35,339483,299569,39914,5.935488589201371,1,75.63
36,21,16,5,3.806350449396821,3,86.44 36,113404,85767,27637,3.880596047884128,3,89.06
37,59,51,8,7.129451257264811,1,0.0 37,339071,301962,37109,4.9810532504276015,1,68.83
38,4,0,4,5.744097564369153,9,87.84 38,37623,25897,11726,1.842940132793361,9,89.4
39,74,65,9,8.55536941450684,1,94.34 39,339457,303459,35998,4.646642146558106,1,90.35
40,53,50,3,2.0343384453691136,1,83.05 40,338193,305568,32625,3.841385277835048,1,90.52
41,59,49,10,9.397972944585163,1,63.64 41,339194,307024,32170,3.755174466816314,1,62.3
42,11,7,4,6.121601715336887,5,50.0 42,67848,42269,25579,4.791783523908462,5,68.62
43,10,5,5,4.851318863875822,6,97.06 43,56919,39060,17859,2.5603665363948838,6,85.08
44,34,33,1,1.1351296943911597,2,92.19 44,169214,143969,25245,2.9501977292188872,2,86.87
45,64,59,5,4.125874686055022,1,87.84 45,339975,295349,44626,8.660786623694852,1,92.94
46,74,65,9,9.358024125232479,1,89.8 46,339167,315235,23932,2.5477162793599124,1,86.54
47,49,44,5,2.4843778719133423,1,86.27 47,339934,294192,45742,9.754540171481345,1,87.12
48,51,44,7,7.286472514468783,1,97.83 48,339091,295408,43683,7.997429679411413,1,90.35
49,46,45,1,1.004347586977225,1,86.27 49,339138,306397,32741,3.884597009502997,1,86.57
50,51,44,7,9.455432928862624,1,56.25 50,339966,294305,45661,9.586637018141543,1,88.32
51,16,9,7,8.86206095462283,4,89.33 51,84488,74624,9864,1.4658283776461758,4,97.73
52,75,67,8,8.07417789759667,1,86.79 52,339140,331438,7702,1.2656689838300985,1,92.44
53,53,46,7,3.0669146526063695,1,87.72 53,339252,313600,25652,2.737252979299571,1,87.02
54,57,50,7,3.2235153877813585,1,88.06 54,339109,295087,44022,8.251086295714982,1,94.48
55,67,59,8,4.968519133955913,1,76.0 55,339737,320982,18755,2.0610542552665496,1,87.81
56,25,19,6,6.100212072996646,2,0.0 56,170131,149390,20741,2.3501661595459855,2,18.76
57,1,0,1,5.7982474925454675,28,87.76 57,12099,2270,9829,8.517893008102874,28,86.59
58,49,43,6,6.981561582145566,1,81.82 58,339603,294064,45539,9.51973718760753,1,79.07
59,33,27,6,3.884026094257262,2,90.48 59,169388,133936,35452,5.7533658385673965,2,73.65
60,21,19,2,1.4233483791426025,3,87.93 60,112783,83061,29722,4.660963074614197,3,87.12
61,58,51,7,5.338026073258696,1,84.85 61,339803,296040,43763,8.03102930717676,1,77.07
62,33,28,5,3.660265149660588,2,50.0 62,169490,130630,38860,8.20890898481475,2,59.28
63,10,5,5,9.767449091292056,5,95.0 63,68277,40475,27802,6.460946859444955,5,87.65
64,60,57,3,1.201834548613872,1,91.07 64,340043,298043,42000,6.997089517135705,1,95.75
65,56,51,5,4.987309597274194,1,61.54 65,339335,324924,14411,1.7111982665882988,1,63.53
66,13,8,5,8.525418306404905,4,91.38 66,84598,53748,30850,7.195239628139434,4,87.83
67,58,53,5,6.3843811037941745,1,76.19 67,337396,296343,41053,6.468823743568375,1,76.74
68,21,16,5,5.159531220600393,2,86.21 68,168813,129539,39274,8.584449622455724,2,76.87
69,29,25,4,8.23605831735192,2,80.0 69,168935,129852,39083,8.31382957264006,2,70.86
70,25,20,5,6.466763192894339,3,0.0 70,112790,79928,32862,6.32689728463079,3,27.82
71,3,0,3,4.350935520897277,19,86.79 71,18026,5015,13011,6.059882273135225,19,86.61
72,53,46,7,9.80846133788532,1,96.67 72,339602,294144,45458,9.326244637290127,1,89.2
73,60,58,2,1.1679092884069515,1,66.67 73,337685,301201,36484,4.734530335572703,1,32.94
74,3,2,1,1.18334302651572,34,91.18 74,10000,3294,6706,2.0953399483975383,34,96.77
75,68,62,6,1.983734112137778,1,79.31 75,338999,328054,10945,1.4775733311410093,1,76.91
76,29,23,6,3.103107885085463,2,90.62 76,169928,130689,39239,8.406951084575,2,87.2
77,64,58,6,3.5224268491508823,1,87.72 77,339808,296317,43491,7.860627209955007,1,91.27
78,57,50,7,7.146369144646693,1,94.92 78,340016,310335,29681,3.295575301583255,1,89.97
79,59,56,3,1.629455019599476,1,64.29 79,339322,305288,34034,4.1428568837538,1,61.61
80,14,9,5,5.643369483405839,4,93.33 80,85030,52384,32646,9.612329081824885,4,64.08
81,15,14,1,1.1732603718777255,4,74.19 81,84888,54399,30489,6.8654731084167215,4,86.01
82,31,23,8,7.1503989550318225,2,86.21 82,169804,146055,23749,2.7190649943185607,2,86.62
83,58,50,8,8.797436025155585,1,80.0 83,339457,294036,45421,9.374682516586324,1,79.3
84,25,20,5,1.9671577189537692,2,86.89 84,169248,134215,35033,5.59505906586539,2,86.85
85,61,53,8,9.617953205825893,1,91.78 85,338584,294054,44530,8.791458898209017,1,88.42
86,73,67,6,3.326125890288469,1,96.36 86,338920,299662,39258,5.68526209949427,1,86.69
87,55,53,2,1.1485674376739077,1,65.0 87,338880,293780,45100,9.141536447646898,1,73.22
88,20,13,7,7.033453848869293,3,70.0 88,112317,82242,30075,4.8033650741674165,3,89.16
89,20,14,6,2.980219690735362,2,94.2 89,169307,150951,18356,2.106599827358843,2,87.4
90,69,65,4,1.9069516378037399,1,84.21 90,338997,296291,42706,7.364331823831616,1,86.62
91,57,48,9,7.690296524981362,1,66.67 91,339905,294417,45488,9.303831880532016,1,33.3
92,3,2,1,6.794130441019814,13,72.0 92,26197,8723,17474,9.509741988265437,13,87.41
93,25,18,7,4.972131019351156,3,44.44 93,112773,98573,14200,1.8012576813912844,3,49.96
94,9,4,5,8.769662570180895,7,86.79 94,48507,24233,24274,7.076409771949383,7,87.43
95,53,46,7,4.07981809741165,1,90.77 95,339988,297246,42742,7.388599144805513,1,88.05
96,65,59,6,7.308754805712177,1,77.42 96,338400,297960,40440,6.1158358642271375,1,85.57
97,31,24,7,3.0787732999641575,2,98.15 97,168252,143969,24283,2.8133122321600794,2,87.44
98,54,53,1,1.515769438886239,1,86.67 98,338729,296200,42529,7.193050310873352,1,95.99
99,45,39,6,4.25741567806571,1,28.57 99,338235,324673,13562,1.6556673379589992,1,52.28

1 access_count hits misses mu lambda hit_rate
2 1 63 338919 57 293278 6 45641 5.399654088863246 9.45073508577941 1 90.91 87.09
3 2 66 339569 60 295735 6 43834 4.890335658893015 8.14036449596436 1 86.54 87.19
4 3 52 339121 45 295683 7 43438 4.375444630275031 7.841130117448747 1 93.75 93.79
5 4 48 339726 45 318616 3 21110 1.358965695760079 2.2674748477937965 1 40.0 78.47
6 5 10 67728 4 53145 6 14583 7.946779823996088 1.9491614320948918 5 93.9 87.79
7 6 82 339470 77 298026 5 41444 3.18260808979361 6.571586635600101 1 80.65 77.43
8 7 31 170195 25 131783 6 38412 5.605947602976087 7.611334405003136 2 66.67 29.18
9 8 6 16126 4 4705 2 11421 3.5941156596303507 4.4496294204831255 21 91.67 88.2
10 9 72 339776 66 299674 6 40102 3.8666443154519476 5.998373656353862 1 89.09 87.76
11 10 55 339314 49 297783 6 41531 3.9010358263416967 6.636819845113485 1 78.38 77.12
12 11 37 170006 29 131110 8 38896 3.956909570230068 8.045921601779977 2 93.62 92.35
13 12 47 338799 44 312870 3 25929 1.730567205003155 2.811627158825997 1 83.93 87.45
14 13 56 338380 47 295915 9 42465 5.904039737486446 7.143615488470383 1 92.06 95.62
15 14 63 339295 58 324424 5 14871 6.0088737342639815 1.765483508758194 1 79.31 78.89
16 15 29 168900 23 133246 6 35654 7.357737678743373 5.959911292425263 2 60.0 41.86
17 16 5 37792 3 15821 2 21971 1.450213741204231 9.445879641550164 9 37.5 71.36
18 17 8 42276 3 30167 5 12109 5.826606789353313 1.835890334290284 8 66.67 73.65
19 18 15 113327 10 83461 5 29866 9.95812133184028 4.648600564543203 3 77.78 78.27
20 19 36 169939 28 133012 8 36927 7.712014479036094 6.632144547714242 2 91.25 96.59
21 20 80 339409 73 327834 7 11575 4.633712335874409 1.5219711334160873 1 81.4 86.89
22 21 43 339488 35 294970 8 44518 7.911648101723665 8.640804985015603 1 82.05 89.01
23 22 39 338488 32 301286 7 37202 7.3654252444495425 4.948940599763346 1 92.54 93.0
24 23 67 339243 62 315511 5 23732 2.2670795468704905 2.5215047387858385 1 85.19 93.5
25 24 54 338961 46 316939 8 22022 8.134847295147168 2.364507987541101 1 94.92 87.79
26 25 59 338323 56 297005 3 41318 1.2117597080749123 6.599461843110775 1 80.77 78.51
27 26 26 169708 21 133242 5 36466 3.3524134464900266 6.367528014392565 2 91.67 89.0
28 27 60 339195 55 301871 5 37324 2.7158732876992437 5.003687539185309 1 87.88 86.83
29 28 66 338836 58 294227 8 44609 4.804077627549259 8.69089847442159 1 92.31 89.4
30 29 65 339057 60 303133 5 35924 4.2833971305094645 4.636189613643649 1 80.0 79.99
31 30 35 169136 28 135290 7 33846 9.583225049197923 5.071027599242191 2 91.8 89.99
32 31 61 337940 56 304106 5 33834 3.53247508842331 4.08093995040424 1 40.0 23.8
33 32 5 13512 2 3216 3 10296 9.558530824564308 5.389385006998066 25 72.73 76.19
34 33 22 113049 16 86130 6 26919 8.094454978234637 3.6953335845304562 3 86.67 87.95
35 34 60 339556 52 298625 8 40931 8.888543618416357 6.455201262262219 1 94.03 88.24
36 35 67 339483 63 299569 4 39914 2.453624754290659 5.935488589201371 1 76.19 75.63
37 36 21 113404 16 85767 5 27637 3.806350449396821 3.880596047884128 3 86.44 89.06
38 37 59 339071 51 301962 8 37109 7.129451257264811 4.9810532504276015 1 0.0 68.83
39 38 4 37623 0 25897 4 11726 5.744097564369153 1.842940132793361 9 87.84 89.4
40 39 74 339457 65 303459 9 35998 8.55536941450684 4.646642146558106 1 94.34 90.35
41 40 53 338193 50 305568 3 32625 2.0343384453691136 3.841385277835048 1 83.05 90.52
42 41 59 339194 49 307024 10 32170 9.397972944585163 3.755174466816314 1 63.64 62.3
43 42 11 67848 7 42269 4 25579 6.121601715336887 4.791783523908462 5 50.0 68.62
44 43 10 56919 5 39060 5 17859 4.851318863875822 2.5603665363948838 6 97.06 85.08
45 44 34 169214 33 143969 1 25245 1.1351296943911597 2.9501977292188872 2 92.19 86.87
46 45 64 339975 59 295349 5 44626 4.125874686055022 8.660786623694852 1 87.84 92.94
47 46 74 339167 65 315235 9 23932 9.358024125232479 2.5477162793599124 1 89.8 86.54
48 47 49 339934 44 294192 5 45742 2.4843778719133423 9.754540171481345 1 86.27 87.12
49 48 51 339091 44 295408 7 43683 7.286472514468783 7.997429679411413 1 97.83 90.35
50 49 46 339138 45 306397 1 32741 1.004347586977225 3.884597009502997 1 86.27 86.57
51 50 51 339966 44 294305 7 45661 9.455432928862624 9.586637018141543 1 56.25 88.32
52 51 16 84488 9 74624 7 9864 8.86206095462283 1.4658283776461758 4 89.33 97.73
53 52 75 339140 67 331438 8 7702 8.07417789759667 1.2656689838300985 1 86.79 92.44
54 53 53 339252 46 313600 7 25652 3.0669146526063695 2.737252979299571 1 87.72 87.02
55 54 57 339109 50 295087 7 44022 3.2235153877813585 8.251086295714982 1 88.06 94.48
56 55 67 339737 59 320982 8 18755 4.968519133955913 2.0610542552665496 1 76.0 87.81
57 56 25 170131 19 149390 6 20741 6.100212072996646 2.3501661595459855 2 0.0 18.76
58 57 1 12099 0 2270 1 9829 5.7982474925454675 8.517893008102874 28 87.76 86.59
59 58 49 339603 43 294064 6 45539 6.981561582145566 9.51973718760753 1 81.82 79.07
60 59 33 169388 27 133936 6 35452 3.884026094257262 5.7533658385673965 2 90.48 73.65
61 60 21 112783 19 83061 2 29722 1.4233483791426025 4.660963074614197 3 87.93 87.12
62 61 58 339803 51 296040 7 43763 5.338026073258696 8.03102930717676 1 84.85 77.07
63 62 33 169490 28 130630 5 38860 3.660265149660588 8.20890898481475 2 50.0 59.28
64 63 10 68277 5 40475 5 27802 9.767449091292056 6.460946859444955 5 95.0 87.65
65 64 60 340043 57 298043 3 42000 1.201834548613872 6.997089517135705 1 91.07 95.75
66 65 56 339335 51 324924 5 14411 4.987309597274194 1.7111982665882988 1 61.54 63.53
67 66 13 84598 8 53748 5 30850 8.525418306404905 7.195239628139434 4 91.38 87.83
68 67 58 337396 53 296343 5 41053 6.3843811037941745 6.468823743568375 1 76.19 76.74
69 68 21 168813 16 129539 5 39274 5.159531220600393 8.584449622455724 2 86.21 76.87
70 69 29 168935 25 129852 4 39083 8.23605831735192 8.31382957264006 2 80.0 70.86
71 70 25 112790 20 79928 5 32862 6.466763192894339 6.32689728463079 3 0.0 27.82
72 71 3 18026 0 5015 3 13011 4.350935520897277 6.059882273135225 19 86.79 86.61
73 72 53 339602 46 294144 7 45458 9.80846133788532 9.326244637290127 1 96.67 89.2
74 73 60 337685 58 301201 2 36484 1.1679092884069515 4.734530335572703 1 66.67 32.94
75 74 3 10000 2 3294 1 6706 1.18334302651572 2.0953399483975383 34 91.18 96.77
76 75 68 338999 62 328054 6 10945 1.983734112137778 1.4775733311410093 1 79.31 76.91
77 76 29 169928 23 130689 6 39239 3.103107885085463 8.406951084575 2 90.62 87.2
78 77 64 339808 58 296317 6 43491 3.5224268491508823 7.860627209955007 1 87.72 91.27
79 78 57 340016 50 310335 7 29681 7.146369144646693 3.295575301583255 1 94.92 89.97
80 79 59 339322 56 305288 3 34034 1.629455019599476 4.1428568837538 1 64.29 61.61
81 80 14 85030 9 52384 5 32646 5.643369483405839 9.612329081824885 4 93.33 64.08
82 81 15 84888 14 54399 1 30489 1.1732603718777255 6.8654731084167215 4 74.19 86.01
83 82 31 169804 23 146055 8 23749 7.1503989550318225 2.7190649943185607 2 86.21 86.62
84 83 58 339457 50 294036 8 45421 8.797436025155585 9.374682516586324 1 80.0 79.3
85 84 25 169248 20 134215 5 35033 1.9671577189537692 5.59505906586539 2 86.89 86.85
86 85 61 338584 53 294054 8 44530 9.617953205825893 8.791458898209017 1 91.78 88.42
87 86 73 338920 67 299662 6 39258 3.326125890288469 5.68526209949427 1 96.36 86.69
88 87 55 338880 53 293780 2 45100 1.1485674376739077 9.141536447646898 1 65.0 73.22
89 88 20 112317 13 82242 7 30075 7.033453848869293 4.8033650741674165 3 70.0 89.16
90 89 20 169307 14 150951 6 18356 2.980219690735362 2.106599827358843 2 94.2 87.4
91 90 69 338997 65 296291 4 42706 1.9069516378037399 7.364331823831616 1 84.21 86.62
92 91 57 339905 48 294417 9 45488 7.690296524981362 9.303831880532016 1 66.67 33.3
93 92 3 26197 2 8723 1 17474 6.794130441019814 9.509741988265437 13 72.0 87.41
94 93 25 112773 18 98573 7 14200 4.972131019351156 1.8012576813912844 3 44.44 49.96
95 94 9 48507 4 24233 5 24274 8.769662570180895 7.076409771949383 7 86.79 87.43
96 95 53 339988 46 297246 7 42742 4.07981809741165 7.388599144805513 1 90.77 88.05
97 96 65 338400 59 297960 6 40440 7.308754805712177 6.1158358642271375 1 77.42 85.57
98 97 31 168252 24 143969 7 24283 3.0787732999641575 2.8133122321600794 2 98.15 87.44
99 98 54 338729 53 296200 1 42529 1.515769438886239 7.193050310873352 1 86.67 95.99
100 99 45 338235 39 324673 6 13562 4.25741567806571 1.6556673379589992 1 28.57 52.28

57
note.md
View File

@ -20,3 +20,60 @@ lambda(i) is zipf distribution describing the rate the client requests the objec
Inter arrival time of each object => exponential Inter arrival time of each object => exponential
Hit rate and the average age of the object based on TTL Hit rate and the average age of the object based on TTL
## Notes 11/13/2024
### Limitations of time
Run the simulation not time based but based on when the least ranked object is requested
at least times for example.
Least ranked object -> least zipf value
2-3h
### mu
Simulate lambda and mu to see what increases the cost function
### Bandwidth
Finite bandwidth between cache and server
miss requests and cache updates should not go over the bandwidth
### Two versions
1.
- Do Refresh
- Do Request
2.
- Just Request
- No Refresh
3.
- LRU
- Infinite TTL
- No Refresh
4.
- Random eviction
- Regular TTL
- With Refresh
5.
- Random eviction
- Regular TTL
- Without Refresh
### Runtime
CPU times: user 3min 46s, sys: 43 s, total: 4min 29s
Wall time: 4min 29s
for ACCESS_COUNT_LIMIT = 10_000 # Total time to run the simulation