Hacker News new | ask | show | jobs
by forkqueue 5504 days ago
mmap is how the Varnish web cache works - the cache files is mmaped in, and the kernel does the rest.

Given the awesome performance of Varnish, I am surprised more applications haven't taken this approach.

2 comments

Varnish is good because the size of a web page fits nicely with the size of memory pages... if you have very many small objects, you'll have to get a bit more clever about how you place them.
For what it's worth, I've written several projects that entirely rely on mmap()ed memory:

Localmemcache (key-value database): http://localmemcache.rubyforge.org/

clispy (Port of PNorvig's lispy to C): https://github.com/sck/clispy