Created
November 14, 2018 16:23
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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