Is currently full (15G) and staying there. Figure out who is using it for what.
How to audit
$ ssh tools-redis # get redis-rdb-tools $ git clone https://github.com/sripathikrishnan/redis-rdb-tools $ cd redis-rdb-tools $ virtualenv venv $ source venv/bin/activate $ python setup.py develop # copy the rdb dump $ sudo cp /srv/redis/tools-redis-XXXX.rdb tools-redis-valhallasw-dump.rdb $ sudo chown valhallasw tools-redis-valhallasw-dump.rdb && chmod 600 tools-redis-valhallasw-dump.rdb # create memory.csv $ rdb -c memory tools-redis-valhallasw-dump.rdb > memory.csv
then run the following script:
import csv import collections import sys def sizeof_fmt(num, suffix='B'): for unit in ['','K','M','G','T','P','E','Z']: if abs(num) < 1024.0: return "%3.1f%s%s" % (num, unit, suffix) num /= 1024.0 return "%.1f%s%s" % (num, 'Y', suffix) reader = csv.DictReader(sys.stdin) sizes = collections.defaultdict(lambda: 0) numkeys = collections.defaultdict(lambda: 0) #sizeperlen = [ for line in reader: name = line['key'] size = int(line['size_in_bytes']) for l in range(3,15): sizes[name[:l]] += size numkeys[name[:l]] += 1 try: int(name, 16) except ValueError: pass else: sizes['!! hash without prefix'] += size numkeys['!! hash without prefix'] += 1 outfile = open('out1.tab', 'w') lastsize = -1 lastline = "" for k in sorted(sizes.keys()): size = sizes[k] if size < 100000: continue if k.startswith('rq:job:'): continue line = k + '\t' + sizeof_fmt(numkeys[k], "") + '\t' + sizeof_fmt(size) + "\n" if size != lastsize: line = k + '\t' + sizeof_fmt(numkeys[k], "") + '\t' + sizeof_fmt(size) + "\n" if size != lastsize: outfile.write(lastline) lastline = line lastsize = size outfile.write(lastline)
using
$ pv memory.csv | python step1.py
and then read out1.tab.