This repository contains a service for managing process slices and monitoring them via systemd. It allows for easy package changes, process management, and error monitoring.
To install the service and ensure it runs on startup, follow these steps:
-
Create the systemd service file:
sudo nano /etc/systemd/system/process-slice-manager.service
-
Create the script that will be used by the service:
sudo nano /usr/local/bin/process-slice-manager.sh
-
Make the script executable:
sudo chmod +x /usr/local/bin/process-slice-manager.sh
-
Reload systemd to recognize the new service and enable it to start at boot:
sudo systemctl daemon-reload sudo systemctl enable process-slice-manager.service sudo systemctl start process-slice-manager.service
To monitor the service logs, open another terminal and run the following command:
tail -f /var/log/process-slice-manager.log
When you change the hestia package, apply the changes by sending a HUP
signal to the process manager:
sudo kill -HUP $(cat /var/run/process-slice-manager.pid)
If you have changed the code, reload the systemd daemon and restart the service:
sudo systemctl daemon-reload
sudo systemctl restart process-slice-manager.service
-
Create a user in HestiaCP and create a web domain
domain1.com
with DNS settings. If you're on Windows, change thehosts
file to point the domains to the Hestia server IP (192.168.209.58
):192.168.209.58 domain1.com 192.168.209.58 domain2.com
-
In HestiaCP, use the Folder Manager to navigate to the
public_html
folder ofdomain1.com
. Deleteindex.html
, replace it withindex.php
, and paste the contents ofcpu_ram_stress.php
from this repository. -
You can now run the PHP test by setting the maximum amount of RAM and the percentage of CPU usage.
-
Check
htop
to see if the user is properly limited according to the package settings.