Announcement

Collapse
No announcement yet.

How to limit shell script as root with LVE settings? (Limit root script by cpu and disk io?)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to limit shell script as root with LVE settings? (Limit root script by cpu and disk io?)

    How can I run a shell script as root so that the script is limited by LVE?

    For example, I have a shell script that runs every day with cron. It is very cpu and io intensive and I want to "limit" the script to use a maximum of 1 cpu and 5MB/s disk io.

    Is this possible?

  • #2
    Hello,
    Thank you for reaching out! You can make your custom lve and add a process to it with lve_suwrapper

    Code:
    lvectl set 10000 --speed=100% --io 5000 --iops 5000 --mem 4G
    
    lve_suwrapper 10000   /script
    
    lveinfo --id 10000
    This information in our documentation will be useful here https://docs.cloudlinux.com/cloudlin...ams-inside-lve.
    If you have any other questions, feel free to ask here. Thank you for contacting us.

    Comment

    Working...
    X