Message ID | 20200818110845.3825105-1-david.edmondson@oracle.com (mailing list archive) |
---|---|
Headers | show |
Series | block/curl: Add caching of data downloaded from the remote server | expand |
On Tue, Aug 18, 2020 at 12:08:36PM +0100, David Edmondson wrote: > When using qemu-img to convert an image that is hosted on an HTTP > server to some faster local (or pseudo-local) storage, the overall > performance can be improved by reading data from the HTTP server in > larger blocks and by caching and re-using blocks already read. This > set of patches implements both of these, and adds a further patch > allowing an offset to be added to all of the HTTP requests. Hi David, Thanks for posting this! Kevin and Max are the maintainers in this area, but I wanted to ask an initial question: Is caching curl-specific or could this be implemented as a block filter driver so that it can be stacked on top of other network protocols too? Thanks, Stefan
On Wednesday, 2020-08-19 at 15:11:37 +01, Stefan Hajnoczi wrote: > On Tue, Aug 18, 2020 at 12:08:36PM +0100, David Edmondson wrote: >> When using qemu-img to convert an image that is hosted on an HTTP >> server to some faster local (or pseudo-local) storage, the overall >> performance can be improved by reading data from the HTTP server in >> larger blocks and by caching and re-using blocks already read. This >> set of patches implements both of these, and adds a further patch >> allowing an offset to be added to all of the HTTP requests. > > Hi David, > Thanks for posting this! Kevin and Max are the maintainers in this area, > but I wanted to ask an initial question: > > Is caching curl-specific or could this be implemented as a block filter > driver so that it can be stacked on top of other network protocols too? This implementation is curl specific, as you probably surmised. I will look at implementing something similar as a block filter. dme.
On 19.08.20 16:19, David Edmondson wrote: > On Wednesday, 2020-08-19 at 15:11:37 +01, Stefan Hajnoczi wrote: > >> On Tue, Aug 18, 2020 at 12:08:36PM +0100, David Edmondson wrote: >>> When using qemu-img to convert an image that is hosted on an HTTP >>> server to some faster local (or pseudo-local) storage, the overall >>> performance can be improved by reading data from the HTTP server in >>> larger blocks and by caching and re-using blocks already read. This >>> set of patches implements both of these, and adds a further patch >>> allowing an offset to be added to all of the HTTP requests. >> >> Hi David, >> Thanks for posting this! Kevin and Max are the maintainers in this area, >> but I wanted to ask an initial question: >> >> Is caching curl-specific or could this be implemented as a block filter >> driver so that it can be stacked on top of other network protocols too? > > This implementation is curl specific, as you probably surmised. I will > look at implementing something similar as a block filter. I think from an implementation standpoint the best would be if we could just use such a generic caching block filter above all curl nodes so we can drop all caching from curl. However, I suppose then we’d at least have the problem of how to put this cache node on top of all curl nodes without breaking compatibility, which may be impossible. OTOH, maybe it would be fine to leave the new cache optional, and just leave the curl driver itself as it is. Which would also mean that wouldn’t need readahead support in the cache driver. But if we do need this full cache directly in the curl driver, is it at least possible to share most of the caching code between it and a (potential future) dedicated cache block driver? Max