-
I recently started using Foyer to cache objects stored on S3. I'm using version 0.12 from the main branch. Let me start by saying that I like it a lot, it was very easy to get started and I love the My workload uses files of different sizes, ranging from 500KiB to 150MiB or more1. It also downloads a lot of files in short burst. We're talking about a few Gigabytes in <30s if it can. I noticed that by changing the configuration I can get very different results in speed in my workload (it benefits a lot from cached data). I tried to look at the configuration options but there are a lot of them and not everything is clear.
I think these options would be a lot easier to understand if I had a good mental model of Foyer, but at the moment how it works it's a bit fuzzy 2. I think a guide explaining the "life of a request" to Footnotes |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hi, @fracek . Thanks for asking. Sorry for the late reply. I just came back from vacation. For your questions, let me answer them one by one. First, based on your workload, if you are using the main branch, make sure you use the large object engine only. The mixed engine won't help in your case.
You can start with the default configuration or 8/16/32/64. You don't need to take care of it if you have not met a problem with it. You can monitor the overhead of locking related to sharding via
Yes, you are right! A rate limiter is all you need for most cases. It is recommended to be 80% of the disk write throughout. Besides, if you have a better knowledge of your workload, you can use a customized adissmion picker.
Reclaimer is used to evict a region when the disk cache is full and need more space for the flushers. It deletes the indexer for the evicted entries and do reinsertion (if a reinsertion picker is set). However, setting a reinsertion is risky if the policy is not good enough. In most cases, you will not need it. You can scale it with flushers, but you don't need too many reclaimers. 1/2/4/8 is enough for most cases.
Yes. BTW, could you please provide the error you got? It is expected to raise a warning and reject the entry. Raising errors or panics should be bugs.
Yes. It is for preventing from too many entries piled up in the channel.
It is used to control when the reclaimers should wake up and do reclamation. You can use the default configuration (without providing a value). |
Beta Was this translation helpful? Give feedback.
-
And thank you for your advice @fracek . I'm working on the comments and documents. Please ask for anything you need. Let's make them better. 🙌 |
Beta Was this translation helpful? Give feedback.
-
This may be related to the in-memory cache. Please let me know if the disk cache also has the problem. #467 |
Beta Was this translation helpful? Give feedback.
Hi, @fracek . Thanks for asking. Sorry for the late reply. I just came back from vacation.
For your questions, let me answer them one by one.
First, based on your workload, if you are using the main branch, make sure you use the large object engine only. The mixed engine won't help in your case.
You can start with the default configuration or 8/16/32/64. You don't need to take care of it if you have not met a problem with it. You can monitor the overhead of locking related to sharding via
perf
andflamegraph
.