Forums

Performance issue with scheduled task (MySQL DB, CPU Usage 3%)

Hi I have a screener that screens almost 1800 stocks and updates the computation in the DB. I was using Sqlite earlier and now I have migrated to MySQL after reading some posts. Though I did not notice much difference honestly.

Anyways the thing that troubled me is that I have a scheduled task that does the data ingestion and computation in the DB. It ran on 16th Dec and it took 18 mins to complete (Completed task, took 1095 seconds, return code was 0.) which is OK It again ran on the next day as it is a daily scheduled task but this time it took 42 mins to complete (Completed task, took 2536.93 seconds, return code was 0.) which just blew my mind.

There has been no change in the code at all but I could not understand why such a difference in the computation when I did not even change a single line of code.

Also on my local machine it never goes beyond 20 mins for the full computation.

Could anyone please throw a light on this?

You will need to add some more detailed logging to your script to check when does it spend that time.