In Kyoto Cabinet Database using File Hash Database, how can avoid file size increasing? In Kyoto Cabinet Database using File Hash Database, how can avoid file size increasing? database database

In Kyoto Cabinet Database using File Hash Database, how can avoid file size increasing?


Try this:

db.kch#dfunit=8

That means the KC runs defrag for every 8 fragmentation detected, and 8 is actually recommended by Mikio.

Available options are listed here, however it could use some polish.

http://fallabs.com/kyotocabinet/command.html


running:

kchashmgr defrag path_to_kcabinet_file

is what i do to get the db file 'resized'. I didn't find the api access to this, that's why i do it with a shell command using kchashmgr utility (obviosuly this can be called from inside a program).


I haven't used this particular db but in some other ones a hack to resolve this issue is to copy the db into a new one, and then delete the old one. After making sure it copied well :).

I've implemented this process into production systems, as long as it is coded really really well it should work.