Very long cron job (days)

I have instance with more than 4k users and more than 10mln files
My cron.php run sometimes 3-5 days
Can I optimize it somehow?

Service run very good… I have good optimized hardware and all system.
Only problem is with long cron job (running from CLI).

I talk about https://nch.pl/

If you take a look in the oc_jobs table, it should list all the jobs run, together with when they run for the last time and how long it took.

In case the cronjobs fails at some point with some error and never finishes, it might be worth running it manually from command line.

This depends on the job that is taking so much time. But in general, the cronjob is supposed to take time more in the range of minutes. For your size of setup, I cannot really tell, it depends on usage as well (user activity, apps, …). But there is a chance that something is going wrong somewhere.