This process:
“frappe.utils.bench_helper frappe schedule”
is eating 80-90% of CPU all the time - which looks to me (as a novice in the framework) as if something is scheduled that it is trying to do and not getting done.
Can I stop this?
Is it perhaps a use-case problem? - Could I check what is in the scheduled queue to do and perhaps remove it? Or tune it so it doesn’t do (or need to do) whatever is taking so long to do?
I don’t mind it needing some resources, but for the last few years running ERPNext on Frappe cruised along at 1 to 10% CPU usage with some occasional large blips. I have not seen it consuming this much for this long.
Also, I am fully prepared to accept it’s my doing or some problem in my setup, but I need some help to find the problem.
Many thanks.
Edit: Screenshot of process:
Any solution you found for this issue @RyanSmith
Well, it doesn’t seem that anyone had an idea (no replies to the thread) so I started debugging and found that it was caused by the scheduler that tried to back-post some transactions - for instance work-orders were closed off and needed their consumption or values updated in the GL, but the trigger-happy finance people closed the previous period (month) almost immediately as it ended, so the scheduled jobs tried to run, and then at the end failing because the previous period is closed and it cannot be posted to anymore.
It would be great if the scheduled job could actually check this first.
Anyway, for some months this went unnoticed, but after more than a year and a half, posting back-transactions became a very large CPU-heavy job, so it would run for some hours and then still fail and roll back at the end.
I then opened all the periods back for 2 years (to the horror of the finance people) and let it run, but now it was clear the process ran and took so long that it timed out, still failing, but now because of timeout reached.
I figured all this out then made a new post asking about the back dated transactions and avoiding the timeout, to which someone explained to me how to make the job timeout longer via bench, which is what eventually solved my problem.
No idea if this is what you are facing, but there’s my story - hope it helps!
Link to the other thread mentioned