• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

Issue Plesk daily job overwhelming server / MySQL

OlgaKM

Basic Pleskian
I am having an issue where the Plesk daily job (/usr/local/psa/admin/plib/DailyMaintainance/script.php) is overwhelming the server, particularly MySQL. This happens for between 5-10 minutes every day when the job is running. As far as I can see what is happening is that the job consumes so many resources that processes connect to MySQL, but are left hanging because they don't have the resources to run and this results in them taking up MySQL connections. Eventually, new processes start receiving a 'Too many connections' error. The max_connection limit for mysql is set to 512.

Is there a way to limit the resources used by the daily job?
 
Last edited:
Thank you serverpoint, that link was very helpful in diagnosing the issue. Ultimately, the solution I used was to use cgroups to limit disk i/o of the process.

Code:
service cgconfig start
cgcreate -g blkio:/limit1M
cgset -r blkio.throttle.write_bps_device="8:0 1048576" limit1M
cgset -r blkio.throttle.read_bps_device="8:0 1048576" limit1M

Then, in the file /etc/cron.daily/50plesk-daily, I changed the following line:

Original line:
Code:
/usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/DailyMaintainance/script.php >/dev/null 2>&1

Modified line:
Code:
cgexec --sticky -g blkio:/limit1M /usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/DailyMaintainance/script.php >/dev/null 2>&1
 
Back
Top