May 26th, 2003


beach, distributed cache daemon

Went to the beach yesterday with my family and whitaker. The weather kicked ass. We flew kites, went boogey-boarding, played frisbee, and just generally enjoyed the sun.

I came back early to meet bostonsteamer for dinner and work with avva on the finishing touches of the C version of the memory cache thing I talked about earlier. It should be crazy-fast, using epoll (polling that doesn't suck; using the Linux 2.4 backport) via libevent, and Judy for the associative array. And it's recycling objects, avoiding mallocing. I can't wait to see it kick the Perl version's ass. I get so giddy when I get to work in C. Actually avva did all the hard work. I just get to review it and be picky about performance things. I think we're going live with it tonight.

Whitaker's still at the beach. He's found a new best friend in my 14 year old brother. :-)

Relocating memory allocator

So, it turns out the memcached takes up no CPU and makes the site blazing fast (even though we're only caching a few object types so far!).

Unfortunately, it did what we suspected: died hard when its address space got fragmented. (In the meantime I restarted the daemons with much smaller sizes, accounting for the bloat which accumulates over a few hours....)

I jotted out notes for an arena allocation scheme where we only malloc large, fixed-size pages and handle our own placement and and recompaction within those pages. However, I can't believe this hasn't been done before.

I want a memory allocator that lets you register a hook when it wants to move allocations around to defragment, so you can update pointers and whatnot. Anybody know of one?