Input Schema
{
"body": {
"keys": [
{
"bytes": 300,
"key": "session:8f3a9c2e",
"ttl": -1,
"type": "string"
},
{
"bytes": 900000,
"elements": 12000,
"key": "feed:global",
"ttl": -1,
"type": "zset"
}
]
},
"bodyType": "json",
"method": "POST",
"type": "http"
}
Output Schema
{
"example": {
"limitations": [
"Analyses the key list you provide; sizes are taken as given (MEMORY USAGE samples nested values).",
"Big-key thresholds are reference values and can be adjusted."
],
"result": {
"expiry_clusters": [],
"findings": [
{
"detail": {
"elements": 12000,
"threshold": 5000
},
"fix": "Shard the collection by a sub-key; delete it with UNLINK (Redis 4.0+) instead of DEL.",
"key": "feed:global",
"message": "zset with 12000 elements exceeds 5000 elements.",
"rule": "big-collection",
"severity": "warning",
"source": "https://support.huaweicloud.com/eu/bestpractice-dcs/dcs-bp-0220411.html"
},
{
"detail": {
"elements": 12000,
"max_element_bytes": null,
"type": "zset"
},
"key": "feed:global",
"message": "Sorted set exceeds zset-max-listpack-entries 128 or -value 64 bytes and uses the skiplist encoding.",
"rule": "listpack-exceeded",
"severity": "info",
"source": "https://github.com/redis/redis/blob/83937c51afb53e1c69661c8e1533e0e19b896fe1/src/config.c"
},
{
"detail": {
"keys": 1,
"keys_without_ttl": 1
},
"fix": "Check whether these keys are meant to be permanent.",
"message": "1 of 1 keys under \"feed\" never expire.",
"prefix": "feed",
"rule": "no-ttl",
"severity": "info",
"source": "https://redis.io/docs/latest/commands/expire/"
},
{
"detail": {
"keys": 1,
"keys_without_ttl": 1
},
"fix": "Set a TTL when writing (SET ... EX / EXPIRE).",
"message": "1 of 1 keys under \"session\" never expire; the prefix suggests temporary data.",
"prefix": "session",
"rule": "no-ttl",
"severity": "warning",
"source": "https://redis.io/docs/latest/commands/expire/"
}
],
"largest_keys": [
{
"bytes": 900000,
"key": "feed:global",
"ttl": -1,
"type": "zset"
},
{
"bytes": 300,
"key": "session:8f3a9c2e",
"ttl": -1,
"type": "string"
}
],
"patterns": [
{
"bytes": 900000,
"keys": 1,
"no_ttl": 1,
"pattern": "feed:global"
},
{
"bytes": 300,
"keys": 1,
"no_ttl": 1,
"pattern": "session:{id}"
}
],
"prefixes": [
{
"avg_ttl_seconds": null,
"bytes": 900000,
"keys": 1,
"max_bytes": 900000,
"no_ttl": 1,
"prefix": "feed",
"share": 0.9997
},
{
"avg_ttl_seconds": null,
"bytes": 300,
"keys": 1,
"max_bytes": 300,
"no_ttl": 1,
"prefix": "session",
"share": 0.0003
}
],
"summary": {
"findings": 4,
"keys": 2,
"missing_keys_skipped": 0,
"no_ttl_bytes": 900300,
"no_ttl_keys": 2,
"total_bytes": 900300,
"types": {
"string": 1,
"zset": 1
},
"with_ttl_keys": 0
},
"thresholds": {
"big_collection_elements": 5000,
"big_string_bytes": 10240,
"big_total_bytes": 52428800,
"encoding": {
"hash_entries": 512,
"hash_value": 64,
"set_intset_entries": 512,
"set_listpack_entries": 128,
"set_listpack_value": 64,
"zset_entries": 128,
"zset_value": 64
},
"expiry_cluster_min": 100,
"long_key_bytes": 1024
}
},
"service": "redis-key-audit",
"status": "success"
},
"type": "json"
}