Trying to use bulk get and getting timeout exception

I a trying to write a simple java code that do bulk get. i have used both bulkget and asyncget and both raise timeout excpetion.

this is my latest code which also seem to fail. can you help ?

List gets = new ArrayList<>(keys.length);
List results = new ArrayList<>(keys.length);

for (String key : keys) {
gets.add(client.asyncGet(key));
}

for (GetFuture future : gets)
{
try {
results.add(future.get(1, TimeUnit.SECONDS).toString());
} catch (Exception e) {
e.printStackTrace();
}
}

return results;

Actually I think you’re better of really using the getBulk here, but if you’re seeing timeouts there must be something else to it too.

Can you

  • tell us what the full workload is? (or is this all you are running in a script)
  • can you share logs
  • tell us more about your environment? (app severs, db servers, network latency,…)

i started with bulkget and switched to async after getting timeout exception. i will do another run. my test run on aws medium machine, its a single java thread that reads 10-25 items at a time.

change my code to this
Map<String,Object> results = client.getBulk(keys);

got this error

Exception in thread “Thread-8” net.spy.memcached.OperationTimeoutException: Timeout waiting for bulk values: waited 2,500 ms. Node status: Connection Status { ip-172-31-44-108.ec2.internal/172.31.44.108:11210 active: true, authed: true, last read: 0 ms ago }
at net.spy.memcached.MemcachedClient.getBulk(MemcachedClient.java:1568)
at net.spy.memcached.MemcachedClient.getBulk(MemcachedClient.java:1602)
at net.spy.memcached.MemcachedClient.getBulk(MemcachedClient.java:1649)
at com.emc.benchmark.clients.CouchbaseDBClient.mGet(CouchbaseDBClient.java:60)
at com.emc.benchmark.BenchmarkRunner$1.run(BenchmarkRunner.java:164)

@maxrozen okay that still doesn’t bring us closer to the solution :slight_smile: … can you share the logs and tell us more about your environment? (see above)