feat: Configure Redis memory limits for low-memory devices #15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Reduces Redis memory limit from 256MB to 64MB and ensures the optimized Redis configuration is deployed during installation.
Problem
On a Raspberry Pi 3B with 417MB RAM:
maxmemory: 0B)Current Memory Usage (before fix)
Top processes:
Solution
config_templates/redis.confconfigure_redis()function to deploy the configuration during installationMemory Allocation Strategy
For devices with 512MB RAM or less:
Configuration Changes
maxmemory 64mb- Hard limit prevents Redis from consuming excess memorymaxmemory-policy allkeys-lru- Evict least-recently-used keys when limit reachedBenefits
Testing
After installation, verify with:
redis-cli INFO memory | grep maxmemory_humanShould show:
maxmemory_human:64.00M