Tuesday, 13 August 2013

how to reduce the time taken by memcachedClient get() method

how to reduce the time taken by memcachedClient get() method

I am using memcached cache for storing hash value. Earlier I was storing
it in a HashMap. I am storing 1000000 key value pair in both in memcached
and hashMap just for testing. When I apply get method on hash map u got
zero second. But for the same key in memcached I am getting random value
like 15ms or 20ms.
l1 = System.currentTimeMillis();
client1.get(String.valueOf(hg.hash("key" + i.toString())));
l2 = System.currentTimeMillis();
mLogger.info("total time taken in fetching from memcached=" + (l2 - l1));
l1 = System.currentTimeMillis();
l2 = System.currentTimeMillis();
mLogger.info("total time taken in fetching from memcached=" + (l2 - l1));
With hash and without hash I am fetching the same time while fetching the
value from memcached. Can we reduce the get Time from memcached?

No comments:

Post a Comment