diff options
author | dormando <dormando@rydia.net> | 2023-02-18 22:52:41 -0800 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2023-02-27 21:32:08 -0800 |
commit | d2e0d66899cc41b2a77ed15b715cad5dfe0f7740 (patch) | |
tree | 765af8f16a63d63cfa52f17fdccddccb87f70065 /memcached.h | |
parent | a22be2bdbff1bb80be87071aad1caf648d15722b (diff) | |
download | memcached-d2e0d66899cc41b2a77ed15b715cad5dfe0f7740.tar.gz |
crawler: add "lru_crawler mgdump" command
The "metadump" command was designed primarily for doing analysis on
what's in cache, but it's also used for pulling the data out for various
reasons.
The string format is a bit onerous: key=value (for futureproofing) and
URI encoded keys (which may or may not be binary internally)
This adds a command "mgdump", which dumps keys in the format:
"mg key\r\nmg key2\r\n"
if a key is binary encoded, it uses the meta binary encoding scheme of
base64-ing keys and appends a "b" flag:
"mg 44OG44K544OI b\r\n"
when the dump is complete it prints an "EN\r\n"
clients wishing to stream or fetch data can take the mg commands, strip
the \r\n, append any flags they care about, then send the command back
to the server to fetch the full key data.
This seems to use 30-40% less CPU time on the server for the same key
dumps.
Diffstat (limited to 'memcached.h')
-rw-r--r-- | memcached.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/memcached.h b/memcached.h index 79b9a81..f5d801e 100644 --- a/memcached.h +++ b/memcached.h @@ -602,7 +602,7 @@ typedef struct _stritem { // TODO: If we eventually want user loaded modules, we can't use an enum :( enum crawler_run_type { - CRAWLER_AUTOEXPIRE=0, CRAWLER_EXPIRED, CRAWLER_METADUMP + CRAWLER_AUTOEXPIRE=0, CRAWLER_EXPIRED, CRAWLER_METADUMP, CRAWLER_MGDUMP }; typedef struct { |