Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

throttling cpu on PI 4 causes jobs to constantly be missed #978

Open
3 tasks done
tim-oe opened this issue Oct 20, 2024 · 4 comments
Open
3 tasks done

throttling cpu on PI 4 causes jobs to constantly be missed #978

tim-oe opened this issue Oct 20, 2024 · 4 comments
Labels

Comments

@tim-oe
Copy link

tim-oe commented Oct 20, 2024

Things to check first

  • I have checked that my issue does not already have a solution in the FAQ

  • I have searched the existing issues and didn't find my bug already reported there

  • I have checked that my bug is still present in the latest release

Version

3.10.4

What happened?

on a pi 4 2g
I have mariadb running locally with a single python process running
source project https://github.com/tim-oe/WeatherWatch

the following scheduling is working under default frequency:

self._scheduler.add_job(
            sensor,
            "interval",
            minutes=self._schedulerConfig.sensorInterval,
            name=SchedulerSvc.SENSOR_JOB,
            id=SchedulerSvc.SENSOR_JOB,
            coalesce=True,
            max_instances=1,
            replace_existing=True,
        )

        self._scheduler.add_job(
            pimetrics,
            "cron",
            minute=f"2-59/{self._schedulerConfig.piMetricsInterval}",
            name=SchedulerSvc.PI_METRICS_JOB,
            id=SchedulerSvc.PI_METRICS_JOB,
            coalesce=True,
            max_instances=1,
            replace_existing=True,
        )

        if Camera().enable is True:
            self._scheduler.add_job(
                camera,
                "cron",
                minute=f"3-59/{self._schedulerConfig.cameraInterval}",
                name=SchedulerSvc.CAMERA_JOB,
                id=SchedulerSvc.CAMERA_JOB,
                coalesce=True,
                max_instances=1,
                replace_existing=True,
            )

i then was trying to throttle down the idle frequency in
/boot/firmware/config.txt
arm_freq_min=300

then all jos started getting missed:
I added to both job_defaults and to each job misfire_grace_time=60*60

but still jobs are missed

How can we reproduce the bug?

on PI 4 throttle down the idle frequency in
/boot/firmware/config.txt
to
arm_freq_min=300

@tim-oe tim-oe added the bug label Oct 20, 2024
@agronholm
Copy link
Owner

Do I have to buy myself a PI 4 to debug this, or will you do it for me?

@agronholm
Copy link
Owner

What I mean to say is, how do yo know this is a bug in the scheduler, rather than the environment causing processes to stall? I have no way to reproduce this, so I don't think I can help you with what little clues you've provided here.

@tim-oe
Copy link
Author

tim-oe commented Oct 23, 2024

can you provide maybe logging names i can turn debug on that might give me more information i can provide that might shed some light? This is the only process that is running and other than when the scheduled processes run it sits mostly idle.
in increasing the min frequency to 500 the triggers fire.

i'm not sure if the grace period is set properly or how i can tell what the delay that's causing them to miss is. as to the amount of seconds to allow https://apscheduler.readthedocs.io/en/master/userguide.html#controlling-how-much-a-job-can-be-started-late

not sure where you're located but pi's aren't too costly, and with python being pretty much the de-facto language for tinkering with it, i bet there's a lot of projects leveraging your lib on it.

@agronholm
Copy link
Owner

can you provide maybe logging names i can turn debug on that might give me more information i can provide that might shed some light?

Here you go: https://apscheduler.readthedocs.io/en/3.x/userguide.html#troubleshooting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants