Git Product home page Git Product logo

cpuloadgenerator's Introduction

CPU Load Generator (Python 2) ================ travis-badge_ mit-badge_ made-with-python_

This script allows to generate a fixed CPU load for a finite time period. To the purpose, a PI controller is employed. The script takes in input the desired CPU load, the duration of the experiment and the CPU core on which the load has to be generated. The controller and the CPU monitor are implemented in two different threads.

Python 3

Here it is the 3.6 version branch which contains some extended features.

Dependencies

This master branch refers to Python versions 2.7, 3.2, 3.3, 3.4.

Install matplotlib for real time plot of CPU status: :

sudo apt-get install python-matplotlib

Install psutil: :

sudo apt-get install python-psutil

Other dependencies: :

sudo apt-get install python-twisted

Usage

To generate 20% of load on core 0 for 20 seconds run: :

./CPULoadGenerator.py -l 0.2 -d 20 -c 0

To enable real time plot run: :

./CPULoadGenerator.py -p 1

To generate 20% of CPU load on core 0 and on core 1 run: :

./CPULoadGenerator.py -c 1 -l 0.2 | ./CPULoadGenerator.py -c 0 -l 0.2

Example

Dynamics example: 50% load generated on CPU core 0: :

./CPULoadGenerator.py -l 0.5 -d 20 -p 1

Example - 50% load on CPU core 0

cpuloadgenerator's People

Contributors

elgalu avatar gaetanocarlucci avatar igorpelevanyuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cpuloadgenerator's Issues

Python3

Hi!

Is there any interest for a Python3 port of this? I have forked the repository and done it myself (see here) and I could submit a pull request if you'd like.

Exception "ImportError: dynamic module does not define init function (init_path)"

Hello, I am trying to use your tool to generate certain load to CPU at certain time intervals, I just cloned the repository and installed the required Python libraries. When I tried to run as the example I got this error

ImportError: dynamic module does not define init function (init_path)

I am using CentOS 7.3 and Python 3.5.1

Add CPU Max temperature constraint

In addition to target load, it would be really cool to see limiters for Max CPU temperature. Why would this be interesting? Well, when a CPU gets really cold, it can become erratic and crash the entire system. Rather than build a special thermostatically heated enclosure for the computer for the winter (which then becomes something you need to cool in the summer), just generate some load until a Max CPU temperature is reached, then slow down the load generation. That Max CPU temperature is then actually your target Minimum CPU operating temperature. If ambient air temperature gets above the Max CPU temperature, extra load generated should drop to 0. If Ambient temperature goes far below the Max CPU temperature, load will increase until the target extra load generated is achieved. This way, some spare CPU resources will still be available instantaneously, and if needed continuously, extra CPU load generated will drop to 0 as the real system demand is non-zero for a period of time.

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.