Skip to content

Comment on Hammerspace: Persistent, Concurrent, Off-heap Storageparent

Comments

The problem with using the kernel-managed the fs cache is that you don't control it. If the kernel decides it wants to reclaim that memory for some reason, well, guess what, you're going to the spinny metal bits.

Two memcached points: 1. You can run memcached over a unix socket. 2. You can have it use locked memory so it will never page fault.

As others have noted, mmap is another option.

I don't really see your point, because the kernel does plenty of other things on your behalf.

You don't control the process switching to memcached either. It's possible memcached will get descheduled, its data removed from L* caches, and your web server process will have to wait for it to be run again. With the FS cache solution you don't have that issue.

You could tune it (e.g. try to pin memcache to a dedicated core and pin web servers to other cores), but there are settings to tune FS cache behavior as well.

Same with mmap. The kernel can swap pages back to disk in that case too. It seems to boil down to the same thing, so not sure why people are so negative about using the file system. I bet you can write a test comparing serving data via mmap() vs via the file system and they will behave nearly identically.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.