I am executing python script on linux server, and it works perfectly if started manually. It downloads data from SQL server, adds new columns, saves, and loads. It executes one function after another. Below is the part of code from main.py:
balance_histories_part_1_and_2()
user_shift_actions_part_1()
sex_id_correct()
user_shift_actions_part_2_and_3()
user_shift_actions_part_5_and_6()
user_shift_actions_part_ML()
When it is executed manually, what I see in top -u mluser is:
But when I start using crontab, it breaks down all the time (the process is killed):
[Tue Aug 9 08:43:15 2022] Out of memory: Killed process 10806 (python3) total-vm:4445212kB, anon-rss:3906016kB, file-rss:60kB, shmem-rss:0kB, UID:1001 pgtables:7952kB oom_score_adj:0
And there are multiple python processes running:
There are also many python scripts consisting only of one file, and they run in crontab without a problem. What can possibly solve the issue? May be crontab is not good at all for complex scripts and Apache should do better?
We have 16 Gb of Ram on server, but seems the problem is different.