Skip to content
This repository was archived by the owner on Nov 2, 2021. It is now read-only.

Conversation

@johnsocg
Copy link

The first patch fixes handling of -I arguments. Traditional memcached behaviour and fatcache usage text both dictate the argument should be specified in bytes. Internally it was being treated as if it were megabytes.

The second patch, again for traditional memcached compatibilty (existing scripts, config files,etc), adds the ability to append a unit suffix k/K or m/M to specify the slab size as KiB or MiB, respectively, via the command line.

@manjuraj
Copy link
Collaborator

Thanks for the patch @johnsocg

Fatcache is designed to be different from traditional memcache. The design of the fatcache (batch writes) dictates that writes happen at slab size granularity and given SSD erase granularity, this needs to be multiple of MB. This is the reason why the slab sizes command-line argumentis is considered as multiple of MB.

@manjuraj manjuraj closed this Feb 19, 2013
@johnsocg
Copy link
Author

@manjuraj

Understandable. It still doesn't change the fact that the usage dictates specifying slab size in bytes, and the value is modified internally, unbeknownst to the user, to an undocumented, arbitrary alignment.

I've added an additional commit (johnsocg@242ceee) that only allows specifying slabs as multiples of 1MB. Otherwise, it'll exit on error the same as if a slab is too large or too small.

I believe this route is more user-friendly than just updating the usage string to say "use MB", but I don't want to spam pull requests. If you're interested in the change, I'll create a new one.

@manjuraj
Copy link
Collaborator

Ah!, I see your point. You are saying that the following usage indicates that we expect the input as bytes and not multiple of MB

-I, --slab-size=N : set slab size in bytes (default: 1048576 bytes)

We can fix the usage. However, I would like the command-line to take slab-size input as multiple of MB

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants