Allow to disable monitor crons
I think we should be able to disable monitor crons. All of them at once, or one by one.
We are managing an ISPConfig server with 5 wordpress multisites hosting around 600 websites each. What it means is that we have 5 databases with around 20000 tables each. It is working quite well, but it is quite unmanageable for the monitor_database_size
cron, which calls some long queries.
# Time: 190520 12:00:18
# Query_time: 16.847866 Lock_time: 0.000098 Rows_sent: 1 Rows_examined: 15982
SELECT SUM(data_length+index_length) FROM information_schema.TABLES WHERE table_schema='db644287598';
# Time: 190520 12:00:30
# Query_time: 12.230618 Lock_time: 0.000131 Rows_sent: 1 Rows_examined: 11232
SELECT SUM(data_length+index_length) FROM information_schema.TABLES WHERE table_schema='db644287599';
# Time: 190520 12:00:45
# Query_time: 15.151571 Lock_time: 0.000167 Rows_sent: 1 Rows_examined: 14633
SELECT SUM(data_length+index_length) FROM information_schema.TABLES WHERE table_schema='db644287600';
# Time: 190520 12:01:05
# Query_time: 19.879997 Lock_time: 0.000296 Rows_sent: 1 Rows_examined: 19716
SELECT SUM(data_length+index_length) FROM information_schema.TABLES WHERE table_schema='db644287601';
You can see above that the request can take 10 to 20 seconds per database. Every 5 minutes…
In worst case, when we have some load, the cron takes more than 5 minutes, crons piles up and it gets worse and worse.
For now, my fix will be to remove cron.d/100-monitor_database_size.inc.php
, but I think it would be nice to allow this from the ISPConfig webui. And I didn't check but I believe other crons can have significant impacts as well, for a functionnality that is not used by anybody. We have never used the monitor panel.
Thanks.