Steps to reproduce
- Add occ system:cron in a cron
- Wait a few hours
- You can see a lot of cron instances and a CPU overloaded
Expected behaviour
The same behaviour than I had with cron.php : no CPU overloaded
Actual behaviour
Server configuration
Operating system: CentOS 7.7.1908
Web server: apache 2.4.6
Database: mariadb 5.5.64-1
PHP version: 7.2.25
ownCloud version: (see ownCloud admin page) 10.3.1-2.1
Updated from an older ownCloud or fresh install: Updated from 10.2.1
Where did you install ownCloud from: owncloud rpm
The content of config/config.php:
{
"system": {
"instanceid": "ocevydwjehjn",
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"***REMOVED SENSITIVE VALUE***"
],
"datadirectory": "\/owncloud\/data",
"overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
"dbtype": "mysql",
"version": "10.3.1.1",
"dbname": "owncloud",
"dbhost": "localhost",
"dbtableprefix": "oc_",
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"forcessl": true,
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_smtpmode": "php",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"logfile": "\/var\/log\/owncloud\/owncloud.log",
"loglevel": 1,
"ldapIgnoreNamingRules": false,
"maintenance": false,
"app.mail.server-side-cache.enabled": true,
"logtimezone": "Europe\/Paris",
"default_language": "fr",
"preview_libreoffice_path": "\/usr\/bin\/libreoffice",
"preview_office_cl_parameters": " --headless --nologo --nofirststartwizard --invisible --norestore -convert-to pdf -outdir ",
"theme": "",
"memcache.local": "\\OC\\Memcache\\APCu",
"filelocking.enabled": true,
"memcache.locking": "\\OC\\Memcache\\Redis",
"redis": {
"host": "localhost",
"port": 6379
},
"trashbin_retention_obligation": "auto",
"updatechecker": false,
"ldapUserCleanupInterval": "240",
"singleuser": false,
"activity_expire_days": 300,
"onlyoffice": {
"verify_peer_off": true
},
"excluded_directories": [
"AppData"
]
}
}
Are you using external storage, if yes which one: no
Are you using encryption: no
Are you using an external user-backend, if yes which one: LDAP
Before the issue, I had a cron with cron.php and everything was fine
*/15 * * * * php -f /var/www/html/owncloud/cron.php > /dev/null 2>&1
As suggested, I had recently changed my cron with system:cron
*/15 * * * * php -f /var/www/html/owncloud/occ system:cron -q
After one day, I noticed a overloaded CPU, nearly 100%, and I could see many cron instances. The first was not ended, that the other started, and the next again and again :
apache 8462 1.0 1.5 1975892 494228 ? Ss 12:00 2:16 php -f /var/www/html/owncloud/occ system:cron -q
apache 9732 1.0 1.4 1945172 465740 ? Ss 12:15 2:08 php -f /var/www/html/owncloud/occ system:cron -q
apache 11087 1.0 1.3 1912404 437296 ? Ss 12:30 2:05 php -f /var/www/html/owncloud/occ system:cron -q
apache 12374 1.1 1.2 1967176 418756 ? Ss 12:45 2:00 php -f /var/www/html/owncloud/occ system:cron -q
apache 15479 1.2 1.1 1830484 361220 ? Ss 13:15 1:51 php -f /var/www/html/owncloud/occ system:cron -q
apache 16897 1.2 1.0 1816452 338364 ? Ss 13:30 1:46 php -f /var/www/html/owncloud/occ system:cron -q
apache 19772 1.6 0.8 1742420 279716 ? Ss 14:00 1:44 php -f /var/www/html/owncloud/occ system:cron -q
apache 22552 1.1 0.7 1717924 256440 ? Ss 14:30 0:53 php -f /var/www/html/owncloud/occ system:cron -q
apache 23926 2.5 0.7 1703656 243428 ? Ss 14:45 1:33 php -f /var/www/html/owncloud/occ system:cron -q
apache 25300 1.4 2.9 2420308 960892 ? Ss 15:00 0:39 php -f /var/www/html/owncloud/occ system:cron -q
apache 26670 4.5 0.6 1672788 215932 ? Ss 15:15 1:27 php -f /var/www/html/owncloud/occ system:cron -q
apache 28035 1.9 0.6 1652452 196116 ? Ss 15:30 0:19 php -f /var/www/html/owncloud/occ system:cron -q
apache 29453 6.0 0.5 1648212 192164 ? Ss 15:45 0:07 php -f /var/www/html/owncloud/occ system:cron -q
To solve the issue, I had to kill the processes.
After that, the CPU load decreased.
What should be the time between 2 cron ? 15 minutes was fine with cron.php, but makes an issue with system:cron
Regards