Important constraints and behaviors for Memcached commands
masterWhen using Twemproxy as a Memcached proxy, observe these behaviors:
- Key Limits: The maximum length of a key is 250 characters.
- Expiration (
<expiry>):0means the item never expires (though it may be evicted).- Non-zero values can be a Unix timestamp (seconds since 01/01/1970) or an offset in seconds from the current time (up to 30 days).
- Expiry is calculated relative to the server time, not the client time.
- Arithmetic:
decrof0results in0.incrofUINT64_MAXresults in0.
- Storage Logic:
setalways creates a mapping.addonly succeeds if the key is absent.replaceonly succeeds if the key is present.appendandprependignore<flags>and<expiry>values.
- Data Length:
<datalen>can be zero, in which case the<data>block is empty. - Noreply: The
noreplyflag instructs the server to skip sending a response even if an error occurs.