Cron job questions - import cron stalls and then doesn't run again

Your software
My Mautic version is: 5.1.0
My PHP version is: 8.1.1
My Database type and version is: MySQL 5.7.23

Your problem
My problem is:
I understand shared hosting is an issue - we are currently evaluating Mautic and have it running in a shared hosting environment as well as a local docker container.
I’ve noticed similar issues with the import cron on both systems -
I set a batch size, each time the cron starts, it only processes that batch number. So, if I have it set at 1000, every 5 minutes, it will only process 1000 contacts. I assume that is expected.
However - occasionally, the job will not complete and then the next time it’s scheduled to kick off nothing happens.
I’m playing with the settings/timing to find the sweet spot on the shared hosting, knowing that there are more limits there, so decided to try in a docker so I could have more control and have access to the CLI and see more logging hopefully.

Here’s what I’m using for the command:
/usr/bin/php mautic/bin/console mautic:import --limit=1250 -v >> mautic/cron_log/contact_import_cron.log 2>&1

On the shared host, when it fails, it just gets to a percentage and stops, no additional logs, and then stops until I toggle the switch on the import history page. Even though while running well, the batch of records only takes 67.76s to complete, the next one will fail at 98% or 42% or whatever, with plenty of time until the next cron kickoff time.

I’m having similar issues on my docker, where the process just doesn’t kick off, but the logs are not getting populated so I’m not sure where to begin looking.

I did notice that I have to toggle this active/inactive switch in the UI after every failed cron run, is that expected?

I’ve finally found the stride I think works on my shared host and I resolved the issues on the local docker container as well.

I think my questions for clarification still remain if anyone can help point me in the right direction even if it’s in the documentation I can’t seem to find yet -

  1. Each cron cycle runs only the specified batch. I guess I was thinking there’d be a mechanism to just start the process and have it loop through until completed. On the shared host this means lost time, as it seems any time the batching ran past the 2 minute mark, regardless of schedule, it stalled.
  2. If something happens during a batch, and it stops at any given percentage, it has to be cycled with the active/inactive toggle in the UI. I’m curious what that toggle does and if it can be included in another script to run ever 4hours or something so we don’t loose progress if it stalls until someone checks.