|author||Prasanna Kumar Kalever <firstname.lastname@example.org>||2017-06-01 00:31:45 +0530|
|committer||Prasanna Kumar Kalever <email@example.com>||2017-06-05 11:47:16 +0000|
cache: implement LRU cache to hold glfs objects
Problem: ------- 1. Currently, each cli command take ~5 secs for execution. The Maximum latency is due to initializing a glfs object (glfs_init() and friends). 2. OOM kills due to glfs_fini() leaks (~10MB per object) Solution: -------- Caching bipasses glfs_init() calls from the very next command, as in the first command it goes via the glfs_init route, since there will be cache miss. Hence with caching cli command on a local machine should take ~1 sec. ATM, the cache query looks at the volume name only, as the host name will be localhost in our case and transport will be tcp 24007 always. The default cache capacity is 5 i.e there can be a max of five glfs entries in the cache, anything more will lead to release of least recently used object. This way, if there are <= 5 volume in use for block, there will be no glfs_fini() calls, hence no leaks, no OOM's. The next patch will help in making cache capacity configurable. Change-Id: Ia891451cb92cf09959c1aff85976d78302ec7014 Signed-off-by: Prasanna Kumar Kalever <firstname.lastname@example.org> [ndevos: correct compiling+linking against libgfapi.so]
Diffstat (limited to 'rpc/glfs-operations.h')
1 files changed, 1 insertions, 2 deletions
diff --git a/rpc/glfs-operations.h b/rpc/glfs-operations.h
index 150554e..bd6b497 100644
@@ -17,8 +17,7 @@
# include <stdbool.h>
# include <errno.h>
-# include <glusterfs/api/glfs.h>
+# include "lru.h"
# include "block.h"