Giter Club home page Giter Club logo

cache-optimization-simulation's Introduction

Cache Optimization Simulation

Full Report: https://drive.google.com/file/d/1xgbXWiKzZgHonwD_ZOCUkoltmTXoojJ9/view

Demo video: https://www.youtube.com/watch?v=7iPG0C1Et6k

Instructions for running our project: -Ensure Python3, Matplotlib, and Numpy are installed To run with default settings: python SeverSim.py, or python3 ServerSim.py

This will perform a single simulation using the FIFO cache replacement policy. Below is a list of configuration options as well as their defaults. All unwritten arguments will run with default values

Example of running with arguments: python ServerSim.py -u -s 5 -n 5000 -cs 200

-u No arguments, this runs all cache replacement policies on the same set of requests. Ideal for comparing algorithms. Ignores the -t and -l flags as it uses fixed requests instead of time limit and all cache types.

-s = 15 : integer Access speed in mbps, describes the speed of accessing files from outside the institution

-i = 100 : integer Institution speed in mbps, speed of accessing files within the network (from cache)

-n = 20000 : integer Number of files in simulated server

-c = 1 : integer Count of simulations, increase to regenerate files/probabilities and run multiple simulations

-l = 1000 : integer Time limit in seconds, after limit no more requests are generated

-t = 0 : integer 0,1 or 2 Cache type. 0: FIFO, 1: Least Popular, 2: Best Fit

-r = 10000 : integer Request count, ignored unless -u is set. Number of requests per simulation

-rt = .4 : float Round trip time in seconds.

-cs = 1000 : int Cache size in mb

-rps = 10 : int Requests per second

NOTE: below variables involve numpy pareto distribtion which has the PDF: (var1 * (var2 ^ var1) ) / x ^ (var1 + 1)

Execution in code is calculated as: (np.random.pareto(var1) + 1) * var2

-sp1 = 2 : float File size Pareto var1 in above equation

-sp2 = 1/2 : float File size Pareto var2 in above equation

-pp1 = 2 : float File probability Pareto var1 in above equation, but full results are normalized to sum to 1

-pp2 = 1/2 : float File size Pareto var2 in above equation, but full results are normalized to sum to 1

cache-optimization-simulation's People

Contributors

jkornberg avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.