CPULimit

sudo apt-get install cpulimit
cpulimit -p [pid] -l [percentage]
cat << EOF > load.py
i = 0
while True :
    i += 1
EOF
python load.py &
top
================================
   PID  USER  PR  NI   VIRT   RES   SHR  S   %CPU  %MEM    TIME+  COMMAND
  4128  user  25   5  21608  5928  3464  R  100.0   0.3  0:03.53  python
================================
cpulimit -p 4128 -l 5 &
top
================================
   PID  USER  PR  NI   VIRT   RES   SHR  S   %CPU  %MEM    TIME+  COMMAND
  4128  user  25   5  21608  5928  3464  R    5.6   0.3  5:11.00  python
================================

Daiphys is a professional-service company for research and development of leading-edge technologies in science and engineering.
Get started accelerating your business through our deep expertise in R&D with AI, quantum computing, and space development; please get in touch with Daiphys today!

Name*


Email*


Message*




* Indicates required field

Daiphys Technologies LLC - https://www.daiphys.com/

  • Last modified: 2023/05/18 07:48
  • by Daiphys