Code Monkey home page Code Monkey logo

Comments (9)

beef9999 avatar beef9999 commented on August 17, 2024

@michalwy

from ocf.

robertbaldyga avatar robertbaldyga commented on August 17, 2024

Hi @beef9999 . Currently we do not have any plans to implement prefetch. However we surely can consider this.

From technical perspective implementing prefetch in OCF comes with some trade-offs. Normally OCF uses user provided buffers to read data from core, while for prefetch it would need to allocate bigger buffer and then perform memcpy to user buffer. That would increase both latency and CPU utilization.

  • Is that additional latency / CPU utilization cost is acceptable in your scenario?

  • Is your application able to provide any hint about when prefetch would be needed? (That would potentially decrease amount of memcpy operations.)

  • How big prefetches would be needed? Close to cache line size of much bigger?

  • What is expected timeframe? When this feature would be needed?

from ocf.

lihuiba avatar lihuiba commented on August 17, 2024
  • Is that additional latency / CPU utilization cost is acceptable in your scenario?

Yes. As the core is remote, even possibly geographically distributed, extra resource is definitely acceptable.

  • Is your application able to provide any hint about when prefetch would be needed? (That would potentially decrease amount of memcpy operations.)

A simplest approach is a configurable larger refill unit, e.g. 64KB, so that cache will read data from core in unit of 64KB (also aligned to that).
Higher level approaches are also desirable, such as intelligent prefetching based-on realtime access pattern, or trace-based prefetching.

  • How big prefetches would be needed? Close to cache line size of much bigger?

It's better configurable. WAN needs bigger prefetches, while LAN needs smaller ones.

from ocf.

beef9999 avatar beef9999 commented on August 17, 2024

@robertbaldyga

The containerd/overlaybd project is focused on next generation container remote image, and cache has been playing an important role in the whole architecture. We have just released a new file cache that was built on top of OCF:

Overview
Document
Code

What is expected timeframe? When this feature would be needed?

The soon the better... For now the performance of the new ocf cache is not satisfying as I mentioned above, because of the lack of a proper prefetch. So we didn't make it the default cache choice.

I think the priorities to solve this issues would be:

  1. OCF provides an API to query metadata hit
  2. OCF supports larger metadata, like 512KB
  3. OCF supports prefetch internally

3 is optional. I believe with 1 and 2, I myself can then implement an efficient prefetch.

from ocf.

beef9999 avatar beef9999 commented on August 17, 2024

https://github.com/containerd/overlaybd/blob/ecd15832005c0243bf678146a1d7323d83409113/src/overlaybd/fs/cache/ocf_cache/ease_bindings/volume.cpp#L106-L111

This code shows how we do prefetch now in the app side, i.e. , issue a new read in the nearby range every time the core is visited.

from ocf.

gaowayne avatar gaowayne commented on August 17, 2024

@beef9999 I am the owner the PRC for WSR and OCF, could you please send me one email? [email protected], we can chat a little bit about your requirement and opty size for Xeon CPU and Optane SSD.

from ocf.

beef9999 avatar beef9999 commented on August 17, 2024

Any update on this issue? Will OCF provide an API to query metadata hit?

from ocf.

robertbaldyga avatar robertbaldyga commented on August 17, 2024

@beef9999 I think we should create three separate GitHub issues for each of those features (with "enhancement" label). It will make it easier to discuss about more specific details of each of them. Currently we do not have any definite date when those features would be implemented. We will revisit them planning future releases.

from ocf.

robertbaldyga avatar robertbaldyga commented on August 17, 2024

This enhancement has been split into three separate entries: #674, #675 and #676. I'm closing the original one.

from ocf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.