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

Memory usage when replicaCount > 1 #338

Closed
swills opened this issue Feb 6, 2025 · 3 comments
Closed

Memory usage when replicaCount > 1 #338

swills opened this issue Feb 6, 2025 · 3 comments

Comments

@swills
Copy link

swills commented Feb 6, 2025

Since switching my persistentVolumeClaim to a storageClass which supports accessModes ReadWriteMany (and setting it to that), and then increasing replicaCount to 3, I see the pihole containers memory usage grow until they hit the limit and are killed. I also see the stats reset when. Am I doing something wrong? Is this a bug? Or expected?

@swills
Copy link
Author

swills commented Feb 6, 2025

Well, in the logs, I see:

[2025-02-06 05:45:02.346 264/T296] ERROR: SQL query "DELETE FROM network_addresses WHERE lastSeen < 1707284701;" failed: database is locked (SQLITE_BUSY)
[2025-02-06 05:46:00.168 264/T296] Encountered error while trying to store client in long-term database
[2025-02-06 05:46:00.169 264/T296] Statement finalization failed when trying to store queries to long-term database
[2025-02-06 05:46:00.169 264/T296] Error while trying to close database: database is locked
[2025-02-06 05:46:01.304 264/T296] ERROR: SQL query "DELETE FROM network_addresses WHERE lastSeen < 1707284760;" failed: database is locked (SQLITE_BUSY)
[2025-02-06 05:47:01.169 264/T296] ERROR: SQL query "END TRANSACTION" failed: database is locked (SQLITE_BUSY)
[2025-02-06 05:47:01.169 264/T296] END TRANSACTION failed when trying to store queries to long-term database
[2025-02-06 05:47:01.170 264/T296] Keeping queries in memory for later new attempt

So I think that's the source of the issue.

@swills
Copy link
Author

swills commented Feb 6, 2025

This seems like an issue with FTL and isn't really going to be solved without FTL changes (either using SQLite BEGIN CONCURRENT or switching to a different database), so perhaps there should be a warning about increasing replicaCount or it should be removed and hard coded to 1.

@MoJo2600
Copy link
Owner

Yes. This has been an ongoing issue. Pi-Hole is not supporting to run multiple instances in parallel accessing the same database (at least as far as i'm informed). So the increased replicaCount is working, but only if you do not share the database file. I'd like to keep the setting as it is. Some people have been using multiple instances so I don't want to break their setup.

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

No branches or pull requests

2 participants