Skip to content

Severe system lag and database is locked errors during high-frequency detections #584

Description

@BlueGrandala

Describe the bug
As shown in the attached log, the system suffers from severe blocking and I/O bottlenecks during continuous, high-frequency bird calls (e.g., song of Eurasian Skylark). The synchronous writing process appears to block the entire pipeline, causing the system to lag heavily.

To Reproduce
To test the performance, I played a recording of Eurasian Skylark song (around 30s in length). The Web UI immediately becomes extremely slow/unresponsive (this lag lasted for at least 5 minutes). There was also frequent [WARNING] Database busy: database is locked errors, which may indicate that the synchronous write operations are holding the database lock for too long, likely exacerbated by standard SD card write speeds.

The AI processing itself is fast (Time 1.07 SECONDS), but the system is lagging behind real-time by over a minute (Log time 22:21:07 processing an event from 22:19:55). The write process is clearly blocking the entire pipeline.

Expected behavior
Maybe a faster/multiprocess writing pipline? The system should remain responsive even during continuous bird calls. High-frequency detections should not crash the Web UI or cause minutes of processing backlog.

Screenshots

Image

Your build
I used a raspberryPi 4B with 4GB memory and a SD card with 30MB/s writing speed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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