Giter Club home page Giter Club logo

throttlecpu's Introduction

throttleCPU

Set max CPU clock speed on laptops depending on their charging status.

Buying very cheap batteries can result in voltage drops on full CPU load. So I had the problem that compiling, updating, or just starting a browser made my laptop turn off instantly. Throttling CPU clock speed prevents that problem.

throttleCPU reads /etc/throttleCPU.conf and needs those parameters:

All values must be integers.

Parameter Description Unit
DISCHARGE CPU clock speed when the battery is discharging Hz
CHARGE CPU clock speed when the battery is charging Hz
REPEAT The charging status is checked every REPEAT seconds. s

The example config (included with the source) contains this:

DISCHARGE 1000000
CHARGE 3400000
REPEAT 5

Use lscpu to get basic information about you CPU.

Build

git clone https://github.com/k4lipso/throttleCPU
cd throttleCPU
mkdir build; cd build
cmake ..
make
sudo make install

Usage

Setup

throttleCPU can be used like any other systemd service using systemctl.

systemctl daemon-reload
systemctl start/enable throttleCPU.service

Monitoring

To see the latest action of throttleCPU use the systemctl status command:

systemctl status throttleCPU.service

Made on Archlinux, shoud work on other Distos too.

Github

Find this project on Github.

throttlecpu's People

Contributors

k4lipso avatar tropf avatar

Watchers

James Cloos 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.