• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

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