Kyoto Tycoon remove expired recorde from memory

399 views Asked by At

We have small setup of Kyoto Tycoon [Kyoto Tycoon 0.9.55 (2.18) on Linux (Kyoto Cabinet 1.2.75)] which is Fully In-Memory DB & shared in 3 with Master slave architecture for each shared.

Presently we have issue with expired records which stays in memory & memory utilization goes UP.

When I checked this doc http://fallabs.com/kyototycoon/spex.html#tips where I found "ktremotemgr vacuum" as per description it perform full GC operation.

But I was looking for another way like something config parameter which take cares of removing expired records from memory.

Any help on this please

Thanks

1

There are 1 answers

3
bhantol On

kt will do this at random and in some cases it is LRU based. Yes the mem utilization will go up for some time.

Following is some documentation from the same link.

In addition, automatic deletion by the capacity limit is performed at random. In that case, fresh records may also be deleted soon. So, setting effectual expiration time not to reach the limit is very important. If you cannot calculate effectual expiration time beforehand, use the cache hash database instead of the default stash database. The following setting is suggested.
$ ktserver '*#bnum=20000000#capsiz=8g'
Note that the space effiency of the cache hash database is worse than that of the stash database. The limit should be up to 50% of the total memory size of the machine. However, automatic deletion by the "capsiz" parameter (not "ktcapsiz") of the cache hash database is based on LRU algorithm, which prevents fresh records from sudden deletion.