Skip to content

Instantly share code, notes, and snippets.

@LinuxPhreak
Created November 14, 2018 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LinuxPhreak/73dd671d35a61531331265e7802ef82a to your computer and use it in GitHub Desktop.
Save LinuxPhreak/73dd671d35a61531331265e7802ef82a to your computer and use it in GitHub Desktop.
Quick And Dirty Python3 Script To Limit CPU Usuage of Running Processes in Linux using cpulimit tool
#!/usr/bin/env python3
from subprocess import run
print("Limit CPU Usage Of A Running Process \n")
pid = input("PID:")
limit = input("Limit:")
run(["cpulimit", "-l", limit, "-p" pid, "&"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment