2024-11-13 12:00:18 +01:00
|
|
|
# Age Caching Simulation
|
|
|
|
|
2024-11-08 21:38:45 +01:00
|
|
|
Client -> TTL Cache -> Database
|
2024-11-13 12:00:18 +01:00
|
|
|
Capacity C (C = n (example: 100))
|
2024-11-08 21:38:45 +01:00
|
|
|
|
|
|
|
TTL increases on cache hit
|
|
|
|
Age of information / Age of the entry in the cache
|
|
|
|
Database has latest object, cache entry may be old (we don't know)
|
|
|
|
|
|
|
|
Age of entry should have low age of information
|
|
|
|
|
|
|
|
Update function from cache to refresh based on mu (refresh rate)
|
|
|
|
|
|
|
|
Loss function based on TTL and age in cache called beta(i)
|
|
|
|
|
|
|
|
Event based simulation
|
|
|
|
|
|
|
|
lambda(i) is zipf distribution describing the rate the client requests the object "i"
|
|
|
|
|
|
|
|
Inter arrival time of each object => exponential
|
|
|
|
|
2024-11-13 12:00:18 +01:00
|
|
|
Hit rate and the average age of the object based on TTL
|
2024-11-13 16:46:36 +01:00
|
|
|
|
|
|
|
## 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
|
|
|
|
|
feat: add cache simulation with experiments for TTL and eviction strategies
Introduce a new simulation for Age of Information (AoI) cache management, focusing on varying TTL values and eviction strategies (LRU and Random Eviction). This includes:
- New Python script for event-driven cache simulations using .
- Experiments for "No Refresh" across multiple TTL configurations (, , ..., ) with:
- Hit rate and object age tracking (, , etc.).
- Visualizations (e.g., , ).
- Updated to describe experimental setup and configurations.
- Log export file () for simulation results.
- Refactor of with detailed strategy configurations and runtime notes.
### Reason
The commit enhances the project by enabling detailed experiments with configurable cache parameters, supporting analysis of cache efficiency and AoI under varying conditions. This provides a foundation for more sophisticated simulations and insights.
### Performance
- Runtime: ~4m 29s for .
Co-authored experiments introduce structured data files and visualizations, improving clarity for future iterations.
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
2024-11-27 16:31:46 +01:00
|
|
|
- [x] Default
|
2024-11-13 16:46:36 +01:00
|
|
|
|
feat: add cache simulation with experiments for TTL and eviction strategies
Introduce a new simulation for Age of Information (AoI) cache management, focusing on varying TTL values and eviction strategies (LRU and Random Eviction). This includes:
- New Python script for event-driven cache simulations using .
- Experiments for "No Refresh" across multiple TTL configurations (, , ..., ) with:
- Hit rate and object age tracking (, , etc.).
- Visualizations (e.g., , ).
- Updated to describe experimental setup and configurations.
- Log export file () for simulation results.
- Refactor of with detailed strategy configurations and runtime notes.
### Reason
The commit enhances the project by enabling detailed experiments with configurable cache parameters, supporting analysis of cache efficiency and AoI under varying conditions. This provides a foundation for more sophisticated simulations and insights.
### Performance
- Runtime: ~4m 29s for .
Co-authored experiments introduce structured data files and visualizations, improving clarity for future iterations.
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
2024-11-27 16:31:46 +01:00
|
|
|
- Do Refresh
|
|
|
|
- Do Request
|
2024-11-13 16:46:36 +01:00
|
|
|
|
feat: add cache simulation with experiments for TTL and eviction strategies
Introduce a new simulation for Age of Information (AoI) cache management, focusing on varying TTL values and eviction strategies (LRU and Random Eviction). This includes:
- New Python script for event-driven cache simulations using .
- Experiments for "No Refresh" across multiple TTL configurations (, , ..., ) with:
- Hit rate and object age tracking (, , etc.).
- Visualizations (e.g., , ).
- Updated to describe experimental setup and configurations.
- Log export file () for simulation results.
- Refactor of with detailed strategy configurations and runtime notes.
### Reason
The commit enhances the project by enabling detailed experiments with configurable cache parameters, supporting analysis of cache efficiency and AoI under varying conditions. This provides a foundation for more sophisticated simulations and insights.
### Performance
- Runtime: ~4m 29s for .
Co-authored experiments introduce structured data files and visualizations, improving clarity for future iterations.
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
2024-11-27 16:31:46 +01:00
|
|
|
- [x] No Refresh
|
2024-11-13 16:46:36 +01:00
|
|
|
|
feat: add cache simulation with experiments for TTL and eviction strategies
Introduce a new simulation for Age of Information (AoI) cache management, focusing on varying TTL values and eviction strategies (LRU and Random Eviction). This includes:
- New Python script for event-driven cache simulations using .
- Experiments for "No Refresh" across multiple TTL configurations (, , ..., ) with:
- Hit rate and object age tracking (, , etc.).
- Visualizations (e.g., , ).
- Updated to describe experimental setup and configurations.
- Log export file () for simulation results.
- Refactor of with detailed strategy configurations and runtime notes.
### Reason
The commit enhances the project by enabling detailed experiments with configurable cache parameters, supporting analysis of cache efficiency and AoI under varying conditions. This provides a foundation for more sophisticated simulations and insights.
### Performance
- Runtime: ~4m 29s for .
Co-authored experiments introduce structured data files and visualizations, improving clarity for future iterations.
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
2024-11-27 16:31:46 +01:00
|
|
|
- Just Request
|
|
|
|
- No Refresh
|
2024-11-13 16:46:36 +01:00
|
|
|
|
feat: add cache simulation with experiments for TTL and eviction strategies
Introduce a new simulation for Age of Information (AoI) cache management, focusing on varying TTL values and eviction strategies (LRU and Random Eviction). This includes:
- New Python script for event-driven cache simulations using .
- Experiments for "No Refresh" across multiple TTL configurations (, , ..., ) with:
- Hit rate and object age tracking (, , etc.).
- Visualizations (e.g., , ).
- Updated to describe experimental setup and configurations.
- Log export file () for simulation results.
- Refactor of with detailed strategy configurations and runtime notes.
### Reason
The commit enhances the project by enabling detailed experiments with configurable cache parameters, supporting analysis of cache efficiency and AoI under varying conditions. This provides a foundation for more sophisticated simulations and insights.
### Performance
- Runtime: ~4m 29s for .
Co-authored experiments introduce structured data files and visualizations, improving clarity for future iterations.
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
2024-11-27 16:31:46 +01:00
|
|
|
- [x] Infinite TTL
|
2024-11-13 16:46:36 +01:00
|
|
|
|
feat: add cache simulation with experiments for TTL and eviction strategies
Introduce a new simulation for Age of Information (AoI) cache management, focusing on varying TTL values and eviction strategies (LRU and Random Eviction). This includes:
- New Python script for event-driven cache simulations using .
- Experiments for "No Refresh" across multiple TTL configurations (, , ..., ) with:
- Hit rate and object age tracking (, , etc.).
- Visualizations (e.g., , ).
- Updated to describe experimental setup and configurations.
- Log export file () for simulation results.
- Refactor of with detailed strategy configurations and runtime notes.
### Reason
The commit enhances the project by enabling detailed experiments with configurable cache parameters, supporting analysis of cache efficiency and AoI under varying conditions. This provides a foundation for more sophisticated simulations and insights.
### Performance
- Runtime: ~4m 29s for .
Co-authored experiments introduce structured data files and visualizations, improving clarity for future iterations.
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
2024-11-27 16:31:46 +01:00
|
|
|
- LRU
|
|
|
|
- Infinite TTL
|
|
|
|
- No Refresh
|
2024-11-13 16:46:36 +01:00
|
|
|
|
feat: add cache simulation with experiments for TTL and eviction strategies
Introduce a new simulation for Age of Information (AoI) cache management, focusing on varying TTL values and eviction strategies (LRU and Random Eviction). This includes:
- New Python script for event-driven cache simulations using .
- Experiments for "No Refresh" across multiple TTL configurations (, , ..., ) with:
- Hit rate and object age tracking (, , etc.).
- Visualizations (e.g., , ).
- Updated to describe experimental setup and configurations.
- Log export file () for simulation results.
- Refactor of with detailed strategy configurations and runtime notes.
### Reason
The commit enhances the project by enabling detailed experiments with configurable cache parameters, supporting analysis of cache efficiency and AoI under varying conditions. This provides a foundation for more sophisticated simulations and insights.
### Performance
- Runtime: ~4m 29s for .
Co-authored experiments introduce structured data files and visualizations, improving clarity for future iterations.
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
2024-11-27 16:31:46 +01:00
|
|
|
- [x] Random Eviction
|
2024-11-13 16:46:36 +01:00
|
|
|
|
feat: add cache simulation with experiments for TTL and eviction strategies
Introduce a new simulation for Age of Information (AoI) cache management, focusing on varying TTL values and eviction strategies (LRU and Random Eviction). This includes:
- New Python script for event-driven cache simulations using .
- Experiments for "No Refresh" across multiple TTL configurations (, , ..., ) with:
- Hit rate and object age tracking (, , etc.).
- Visualizations (e.g., , ).
- Updated to describe experimental setup and configurations.
- Log export file () for simulation results.
- Refactor of with detailed strategy configurations and runtime notes.
### Reason
The commit enhances the project by enabling detailed experiments with configurable cache parameters, supporting analysis of cache efficiency and AoI under varying conditions. This provides a foundation for more sophisticated simulations and insights.
### Performance
- Runtime: ~4m 29s for .
Co-authored experiments introduce structured data files and visualizations, improving clarity for future iterations.
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
2024-11-27 16:31:46 +01:00
|
|
|
- Random eviction
|
|
|
|
- Regular TTL
|
|
|
|
- With Refresh
|
2024-11-13 16:46:36 +01:00
|
|
|
|
feat: add cache simulation with experiments for TTL and eviction strategies
Introduce a new simulation for Age of Information (AoI) cache management, focusing on varying TTL values and eviction strategies (LRU and Random Eviction). This includes:
- New Python script for event-driven cache simulations using .
- Experiments for "No Refresh" across multiple TTL configurations (, , ..., ) with:
- Hit rate and object age tracking (, , etc.).
- Visualizations (e.g., , ).
- Updated to describe experimental setup and configurations.
- Log export file () for simulation results.
- Refactor of with detailed strategy configurations and runtime notes.
### Reason
The commit enhances the project by enabling detailed experiments with configurable cache parameters, supporting analysis of cache efficiency and AoI under varying conditions. This provides a foundation for more sophisticated simulations and insights.
### Performance
- Runtime: ~4m 29s for .
Co-authored experiments introduce structured data files and visualizations, improving clarity for future iterations.
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
2024-11-27 16:31:46 +01:00
|
|
|
- [x] Random Eviction w/o Refresh
|
|
|
|
- Random eviction
|
|
|
|
- Regular TTL
|
|
|
|
- No Refresh
|
2024-11-13 16:46:36 +01:00
|
|
|
|
feat: add cache simulation with experiments for TTL and eviction strategies
Introduce a new simulation for Age of Information (AoI) cache management, focusing on varying TTL values and eviction strategies (LRU and Random Eviction). This includes:
- New Python script for event-driven cache simulations using .
- Experiments for "No Refresh" across multiple TTL configurations (, , ..., ) with:
- Hit rate and object age tracking (, , etc.).
- Visualizations (e.g., , ).
- Updated to describe experimental setup and configurations.
- Log export file () for simulation results.
- Refactor of with detailed strategy configurations and runtime notes.
### Reason
The commit enhances the project by enabling detailed experiments with configurable cache parameters, supporting analysis of cache efficiency and AoI under varying conditions. This provides a foundation for more sophisticated simulations and insights.
### Performance
- Runtime: ~4m 29s for .
Co-authored experiments introduce structured data files and visualizations, improving clarity for future iterations.
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
2024-11-27 16:31:46 +01:00
|
|
|
| Name | Cache Capacity | MAX_REFRESH_RATE | cache_type | CACHE_TTL |
|
|
|
|
| -------------------- | -------------------- | ---------------- | ------------------------- | --------- |
|
|
|
|
| Default | DATABASE_OBJECTS | 1< | CacheType.LRU | 5 |
|
|
|
|
| No Refresh | DATABASE_OBJECTS | 0 | CacheType.LRU | 5 |
|
|
|
|
| Infinite TTL | DATABASE_OBJECTS / 2 | 0 | CacheType.LRU | 0 |
|
|
|
|
| Random Eviction (RE) | DATABASE_OBJECTS / 2 | 1< | CacheType.RANDOM_EVICTION | 5 |
|
|
|
|
| RE without Refresh | DATABASE_OBJECTS / 2 | 0 | CacheType.RANDOM_EVICTION | 5 |
|
2024-11-13 16:46:36 +01:00
|
|
|
|
|
|
|
### Runtime
|
|
|
|
|
|
|
|
CPU times: user 3min 46s, sys: 43 s, total: 4min 29s
|
|
|
|
Wall time: 4min 29s
|
feat: add cache simulation with experiments for TTL and eviction strategies
Introduce a new simulation for Age of Information (AoI) cache management, focusing on varying TTL values and eviction strategies (LRU and Random Eviction). This includes:
- New Python script for event-driven cache simulations using .
- Experiments for "No Refresh" across multiple TTL configurations (, , ..., ) with:
- Hit rate and object age tracking (, , etc.).
- Visualizations (e.g., , ).
- Updated to describe experimental setup and configurations.
- Log export file () for simulation results.
- Refactor of with detailed strategy configurations and runtime notes.
### Reason
The commit enhances the project by enabling detailed experiments with configurable cache parameters, supporting analysis of cache efficiency and AoI under varying conditions. This provides a foundation for more sophisticated simulations and insights.
### Performance
- Runtime: ~4m 29s for .
Co-authored experiments introduce structured data files and visualizations, improving clarity for future iterations.
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
2024-11-27 16:31:46 +01:00
|
|
|
for ACCESS_COUNT_LIMIT = 10_000 # Total time to run the simulation
|
|
|
|
|
2024-11-29 21:49:59 +01:00
|
|
|
## Notes 11/29/2024
|
|
|
|
|
|
|
|
C_m = cost for cache miss
|
|
|
|
C_delta = cost for refresh
|
|
|
|
C = Cm + C_delta over all objects summarized
|
|
|
|
|
|
|
|
We wanna minimize cost function
|
|
|
|
|
|
|
|
N = number of objects
|
|
|
|
B is cache size
|
|
|
|
|
|
|
|
C_f roughly equals C_m
|