[DGD] swapout tuning

Shentino shentino at gmail.com
Wed Aug 24 20:43:31 CEST 2011


I've been mulling over making some fine tuning to how dgd manages object
swapping.  It's in the experimental stage at the moment on a private branch.

At present, swapout is a fixed fraction of all resident objects getting
dumped to the swap cache, with LRU sectors in that being dropped from cache
as needed once the cache_size is exceeded, dirty ones trickling out to disk.

But after some thinking about working set sizes, I got to thinking that a
mud's "working set" might more closely correlate to the number of objects
resident in dynamic memory, as opposed to the number of sectors in the swap
cache.  A logical vs physical sort of thing.

Additionally, even if I avoid disk I/O from flushing dirty sectors, I have a
hunch that there is runtime overhead from unpacking an object's dataspace
from the swap cache if it is no longer resident in dynamic memory.

One other thing that crossed my mind is that spreading swapout I/O out more
smoothly after a clone storm would create less lag.  Especially since it
appears that a swap sector overflow causes strict clampdown.

This is somewhat related to callout throttling in that it's intended to
reduce unexpected latency.

My current changes so far are exempting a certain number of objects from
swapout (the "logical cache size"), establishing a baseline number of
objects to swap out of those that go above the exemption, and taking a fixed
fraction of that overage in addition to the baseline, to have greater
aggressiveness with larger overages.  This fraction is where the old
"fragment" setting comes into play.

To make up for a possibly decreased rate of swapping and thus garbage
collection, I'm also considering making the "gc velocity" adjustable as
well.

Comments are solicited.



More information about the DGD mailing list