Skip to content

High CPU Load on RcPulseGW #16

@JoHoenk

Description

@JoHoenk

When I run rcpulsegw.py the cpu load increases to 25% on my RPI5.

It does not matter If I run the script out of the commandline or with system.d

PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     ZEIT+ BEFEHL                                                                  
149334 pi        20   0  483440  23040   9728 S  26,0   0,3   0:43.00 python

The CPU load does not drop If I increase the sleep time at the end of the While True loop as well, but If I decrease it the cpu load is even higher.

Profiling the app with cProfile gives me following log:

ncalls  tottime  percall  cumtime  percall filename:lineno(function)
73/1    0.001    0.000    8.270    8.270 {built-in method builtins.exec}
1    0.000    0.000    8.270    8.270 rcpulsegw.py:1(<module>)
9    8.140    0.904    8.140    0.904 {built-in method time.sleep}
105/5    0.001    0.000    0.091    0.018 <frozen importlib._bootstrap>:1167(_find_and_l

In the meantime I could narrow down the issue:
The "problematic" code ist in rcprotocols.py in the run function:
If you disable the receive commands the load drops to idle again.

Is it maybe an issue of GPIO Monitoring for the receive functionality?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions