On Mon, Oct 30, 2017 at 4:45 PM Kamble, Nitin A <Nitin.Kamble@xxxxxxxxxxxx> wrote: > > Hi Greg, > I was going over the ceph-devel mailing list to understand omap better. I found your thread [1] explaining omap. I would like to ask few follow up questions, which should be useful for the whole ceph community. > > What is the need of both omap and xattrs? It's fair to say there's some overlap here. The honest answer is that xattrs exist because filesystems support them so we exposed it, and then later on we added the omap interface because we needed more than xattrs feasibly support. But there are some practical differences in typical deployments (on Filestore). > > How is each used currently? omap is used for lots of key-value data (for instance, RGW stores each bucket index as a series of omap entries), whereas we use xattrs for relatively fixed-size data. > > How to use them, and not misuse them? In general: 1) xattrs have a good chance of being read into memory at the same time as the object's local file inode is, which means if that's all you need you can expect it to be faster/use less disk time. 2) omaps support vastly more entries than xattrs are efficient about (if you use too many, the xattrs "spill over" into the leveldb/rocksdb store we use to back omap, so it's not a huge deal). Also, I believe in Bluestore systems xattrs and omaps are implemented identically. But there's still the convention that xattrs are for small constant-sized data and omaps are used for large lists. -Greg -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html