Nginx: disable open_file_cache if media is on NFS #17251
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.
Proposed change
This change disables nginx's open_file_cache if the /media/frigate/clips directory is detected to be an NFS mount.
#17118 (reply in thread)
Above comment covers the investigation into this in more details; TLDR = the creator of nginx says don't use open_file_cache with NFS mounts due to the filesystem not properly observing unix file semantics: https://trac.nginx.org/nginx/ticket/478
The nginx ticket is from 2014, but seeing as I see an issue without the fix, and it goes away with the fix, fair to assume it's still valid.
I have tested this locally in my devcontainer (non-NFS) and my test instance (NFSv4) and it seems to work fine. I don't observe any performance degradation browsing around the UI. Once betas start and a broader user-base is testing this, happy to look into any performance concerns.
Type of change
Additional information
Checklist
en
locale.ruff format frigate
)