Dear Team,
I am using file db in multi threaded application where user requests are being served from file cache.
-- On application start if new file cache is getting created then response time is very high starting from 10ms to 1000ms and even more.
-- On application start if existing file is being opened then response time is very low like 0 to 2 ms.
-- Now if we reload existing file cache then again response time is getting increased
I am not sure why is it happening, below mentioned is piece of code that i am using in my application.
DB db = DBMaker.fileDB(file) // file db
.fileMmapEnable() // enable memory map file
.fileMmapPreclearDisable().cleanerHackEnable().closeOnJvmShutdown().transactionEnable()
.allocateStartSize(2 * 1024 * 1024 * 1024) // 2GB
.allocateIncrement(64 * 1024 * 1024) // 64MB
.make();
HTreeMap<String, String> hTreeMap = db.hashMap("mydb",Serializer.STRING, Serializer.STRING)
.layout(64 // concurrency
, 16 // node size
, 4 // levels in index tree
).counterEnable().createOrOpen();
To get elements hTreeMap.get(key);
and to put hTreeMap.put(key, value);
db.commit();