A simple script to tame Pingtunnel
As you may know, the Pingtunnel project (https://github.com/esrrhs/pingtunnel) has a serious resource usage issue, which can lead to it being terminated by the OS on virtual machines or even crashing dedicated hosts.
You can use this simple Python script to prevent such issues. The script runs Pingtunnel and automatically kills it when CPU or RAM usage exceeds a certain threshold, then restarts it.
sudo apt update && apt install python3-pip -y
pip install psutil
Open pt.py
and set the values for CPU_THRESHOLD
and RAM_THRESHOLD
according to your needs.
You can also adjust the CHECK_INTERVAL
Use PINGTUNNEL_CMD
to set your Pingtunnel arguments
python3 pt.py
CPU: 95%
RAM: 13%
CPU: 95%
RAM: 95%