Need help understanding the lifecycle of a request #876
Replies: 8 comments 5 replies
-
@MrCroxx any help on this will be greatly appreciated |
Beta Was this translation helpful? Give feedback.
-
Hi, @sanketkedia . Thank you for trying foyer.
If you are using the The in-memory cache insertion is synchronous, while the disk cache insertion is asynchronous to prevent io from blocking the critical path. The disk cache insertion happens on in-memory cache eviction in the latest version (>= v0.14.0), instead of on in-memory insertion in the old versions (<= v0.13.x).
It is batched to gain more throughput. The new disk cache insertion entries will be batched during the IO task of the last batch is on-going. (Like how LevelsDB does.) I'm still working on making the write model more clear. There is an internal API to wait for the previous entries flushing, but I'm not sure if it is a good idea to expose it. Because a cache can drop entries as its wish, waiting doesn't always get persisting.
It will be evicted from the in-memory cache and inserted into the disk cache. The disk cache use a region-based eviction policy. There is no relationship between in-memory cache eviction and disk cache eviction. And the policy is also tunable. Thanks again for trying and asking. Feel free to ask everything about foyer. |
Beta Was this translation helpful? Give feedback.
-
@MrCroxx Thank you for responding! These are really helpful. Couple of more questions:
|
Beta Was this translation helpful? Give feedback.
-
@MrCroxx any help on this? Sorry this is time sensitive on our side as this blocks release hence the followup |
Beta Was this translation helpful? Give feedback.
-
Hi, @sanketkedia . May I ask if you are using the config builder first? Most of the configurations are already tuned and don't need attention if you do not run into any trouble with them.
The MAX batch size is the buffer pool size divided by the flushers. But the batch can be flushed early if the previous IO finished. Just as how LevelDB does it.
No
The buffer pool is used to reduce allocation and page faults of IO buffers. For more details, please refer to the document in the website: https://foyer.rs
It will be overwritten. There will be space amplification. The disk deletion is lazily handled. As last, you can refer to the examples and the documents via the website (The API version in the website is stale, but most of them are still valid). |
Beta Was this translation helpful? Give feedback.
-
I'm sorry to hear that, and I fully understand your predicament. I'm more than willing to provide assistance at my convenience. However, please don't rely too heavily on open-source projects to provide "support" during your working hours. As a fellow contributor to the open-source community, I hope you can understand. At least, please use a reasonable tone to negotiate this matter. If you're in a real hurry and my response time in the open-source community doesn't meet your needs, I'd be more than willing to offer a paid support and consultation service. If you have any concerns, take a look at a topic that once topped Hacker News. https://xuanwo.io/2024/10-a-letter-to-open-source-maintainers/ Please don't misunderstand, I am very willing to answer questions from the open source community and provide help within my abilities. But please understand that I also need to enjoy my weekends and spend time with my family. If I don't reply promptly, I hope you can understand. |
Beta Was this translation helpful? Give feedback.
-
Sorry I didn't mean to offend you. Also, I had no intentions of spoiling your weekend. Please reply at your convenience, I was merely trying to convey the urgency on my end. Also, I had no intentions of using an unreasonable tone, apologies if it came across like that |
Beta Was this translation helpful? Give feedback.
-
For my use-case, I have cache entries that are roughly 8MB in size. Is the default config alright? The default buffer_pool_size is 16MB, isn't this a little less for my use-case? Also, can |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
We have been using Foyer Hybrid Cache and are liking it very much. Thank you so much for building it. It's a great product. However, we've always had difficulties in understanding what's happening under the hood. The docs are below par for a product as good as this. It would be greatly useful if:
cache.insert()
. Does it insert to both in-memory and disk? Does it flush to disk immediately or wait for a certain threshold? If in-memory capacity is full then does it only evict from memory and NOT from disk? When does it evict from disk?, etccache.get()
. What happens if the entry does not exist in memory but exists on disk? What happens if it is not found in both memory and disk? Does it load to both memory and disk in that case?Beta Was this translation helpful? Give feedback.
All reactions