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

Investigate writing to the persistence file #58

Open
tomtrafford opened this issue Sep 12, 2024 · 2 comments
Open

Investigate writing to the persistence file #58

tomtrafford opened this issue Sep 12, 2024 · 2 comments

Comments

@tomtrafford
Copy link
Contributor

tomtrafford commented Sep 12, 2024

SD cards have a tendency to fail, can we reduce how often we write to the SD card? Do we write to it when nothings changes?

Can we investigate moving the persistence file to the QSPI.

Investigate the new SD cards, can we set up a test to see how long it takes an old SD card to fail and see if we can replicate this behaviour on the new SD card.

@tomtrafford tomtrafford changed the title Check if we write persistance file when nothing changes Investigate writing to the persistance file Sep 12, 2024
@tomtrafford tomtrafford changed the title Investigate writing to the persistance file Investigate writing to the persistence file Sep 12, 2024
@Araneidae
Copy link
Contributor

Araneidae commented Sep 12, 2024

The server is actually quite careful not to write too often to the persistence file. The default parameters, overrideable with -t [poll][":"[holdoff][":"backoff]], are (all durations in seconds):

Parameter Default Description
poll 20 How often the state is checked for changes
holdoff 30 Delay from state change being detected to writing update to the persistence file
backoff 60 How long to wait after writing the state before resuming normal polling

This was designed to address precisely the problem you're describing: frequent writes to flash memory can cause wear. The initial delay is so that multiple writes aren't triggered after a group of changes is started, and the backoff slows things down if there are continuous changes.

@Araneidae
Copy link
Contributor

@tomtrafford, does this issue need an action or can it be closed now?

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