Symptoms
Resource Usage is configured for domains and clients, however the configuration does not take effect. Domain limits may be exceeded however notifications are not sent to the owner and the domain is not suspended.What causes the problem?
Cause
In Parallels Plesk Panel 9 statistics is processed with script DailyMaintainance/script.php that is executed from daily cron job:~# cat /etc/cron.daily/50plesk-daily
...
# install_statistics
/usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/DailyMaintainance/script.php >/dev/null 2>&1
...
~#Purpose of the script is the following:
- The script starts utility "statistics" that processes Apache logs for each domain. The utility counts the inbound and outbound traffic, counts the disk space occupied by Web content, log files, databases, mailboxes, Web applications, mailing list archives, and backup files.
- After the "statistics" utility has finished the script processes resource usage for Plesk domains/clients/resellers. According to resource usage settings limits notifications are sent and objects are suspended.
The problem is that the scripts fail due to MySQL execution timeout while utility "statistics" is executed. As a result no notifications are sent and domains/clients with exceeded limits are not suspended.
Resolution
To resolve the problem it is recommended to increase MySQL execution time. By default, the server closes the connection after eight hours if nothing has happened. You can change the time limit by setting the "wait_timeout" variable when you start mysqld.Open MySQL configuration file my.cnf and find variable "wait_timeout" in section [mysqld]. If the variable is missing and you want to increase it is recommended to add the variable.
/etc/my.cnf
--->8---
[mysqld]
wait_timeout=36000
---8<---
By default the value is 28800, 8 hours. Do not forget to restart mysqld to apply the changes:
~# /etc/init.d/mysqld restart
Stopping MySQL: [ OK ]
Starting MySQL: [ OK ]
~#For details about MySQL variables see http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html.