How to limit shell script as root with LVE settings? (Limit root script by cpu and disk io?)
Forum
  1. Forums
  2. General
  3. Programming for CloudLinux
  1. Host Provider
  2. Thursday, 01 October 2020
  3.  Subscribe via email
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?
Rate this post:
  1. 01.10.2020 10:10:34
  2. # 1
Sergey Khristich Accepted Answer
Posts: 466
Joined: 20.05.2019
0
Votes
Undo
Hello,
Thank you for reaching out! You can make your custom lve and add a process to it with lve_suwrapper

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/cloudlinux_os_components/#placing-programs-inside-lve.
If you have any other questions, feel free to ask here. Thank you for contacting us.
Marketing Manager
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!
Guest
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below. Supports gif,jpg,png,zip,rar,pdf
• Insert • Remove Upload Files (Maximum File Size: 2 MB)
Captcha
To protect the site from bots and unauthorized scripts, we require that you enter the captcha codes below before posting your question.