-
Notifications
You must be signed in to change notification settings - Fork 151
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
Option for disabling negative metadata entry cache #831
Comments
Hey @nguyenminhdungpg. Mountpoint will indeed cache the non-existence of a file. We've sometimes described this as 'negative caching'. This behavior was introduced in Mountpoint v1.5.0. It sounds like you would prefer that Mountpoint would not cache these entries, and instead go to S3 each time if it has not seen that the file exists. Can you tell us a bit more about your use case? What problems does caching the negative entries introduce for you? |
Hi @dannycjones thank you for your information. My usecase for using disable_noobj_cache option of s3fs at this time is very weird and it is not good. There are 2 services run in parallel and there is a chance that one requests file in s3fs mounted folder before the other finished adding the file to S3 using AWS SDK for S3. On another hand, I am wondering without 'negative caching', can an attacker brute-force requests to non-existing files and increase my S3 cost? |
Hi @dannycjones Currently I am setting TTL to 6 months but with negative cache is always enabled, some logics in my service are broken. Thank you. |
Hey, we still don't have any updates to share yet. For your use case, I wonder why you set the TTL to be really long? We usually recommend using long TTL for static bucket that its content doesn't change that often. Is it possible to reduce TTL and then you can change logic in your service to do retry? Another option you have is calling |
Hi @monthonk , thank you for your information. I have a service to upload files to S3 using AWS SDK. File will be stored in folder tree with multi level style. File will not be modified or deleted. mount-s3 is used to serve files for my website and my website is very high traffics. My CDN cache is working not well, it still miss many requests and load on mount-s3 is very high at peak time. That's why I set mount-s3 TTL that long, I need files loaded as fast as possible. mount-s3 negative cache does not only cache metadata of files, also folder. So when my service check if a file or folder is existing, folders' non-existence are cached by negative cache and break the logic of next requests (a lot of requests). I just need a way to flag off negative cache like disable_noobj_cache in s3fs. As I see in many system, 404 is normally not cached or cached but with very small TTL. It is reasonable if we can flag off negative cache or negative cache has its own TTL. |
Thanks for clarifying. I assume that your two services are running on different systems, so that writer couldn't access mountpoint directory, and that's why you use AWS SDK to upload the files. Is that correct? |
@monthonk yes, that's correct. I use AWS SDK for upload service and I use s3fs/mount-s3 for file serving service (readonly). |
Thanks for your information @nguyenminhdungpg, I think an option to turn off negative caching is a valid feature request. We will come back to you once we have any news on this. |
@monthonk Thank you. I look forward to hearing from you. |
Hi @monthonk , I'd like to ask a question. |
Hey @nguyenminhdungpg, yes, if you use |
Hi @monthonk , thank you. I've just done an workaround to bypass the negative caching using O_DIRECT and it fetches the file from S3, update the cache. The workaround help resolving my issue but it is great if I can flag of negative caching or set negative caching TTL using mount-s3 command options. (e.g set negative cache TTL to be 30s or 1m). Wish next version of mount-s3 come with this feature. |
If I use --cache option, will mountpoint-s3 not cache metadata of a requested file that is not existing?
In s3fs, there is option disable_noobj_cache that help me to achieve this.
Thank you very much
The text was updated successfully, but these errors were encountered: