Closed GoogleCodeExporter closed 8 years ago
which queue? can you include you're test?
Original comment by ingen...@gmail.com
on 19 Feb 2012 at 5:00
Here is the source fragment:
ConnectionFactory connectionFactory = new DefaultConnectionFactory(10, 1000000);
List<InetSocketAddress> addresses = new ArrayList<InetSocketAddress>();
addresses.add(new InetSocketAddress("10.3.6.238", 11111));
MemcachedClient mc = new MemcachedClient(connectionFactory, addresses);
long t0 = System.nanoTime();
for (int i = 0; i < N; ++i) {
try {
String key = evalKey(i);
data.replace(0, key.length(), key);
mc.set(key, 3600, data.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
mc.waitForQueues(10, TimeUnit.MINUTES);
dt = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - t0);
System.out.println("Time to insert " + N + " entries: " + dt + " millis");
The queue is the "writeQ" if I see correctly.
Original comment by mauri.me...@gmail.com
on 19 Feb 2012 at 5:03
also, which version?
Original comment by ingen...@gmail.com
on 19 Feb 2012 at 5:07
the last one: 2.8.0
Original comment by mauri.me...@gmail.com
on 19 Feb 2012 at 5:33
If I can suggest in
net.spy.memcached.MemcachedConnection.addOperation(String, Operation)
at line: 667
if (placeIn == null) {
placeIn = primary;
this.getLogger().warn(
"Could not redistribute "
+ "to another node, retrying primary node for %s.", key);
}
at this point i would like to have the possibility to cancel the operation if I
can't find alternative node to primary.
What do you think about?
Original comment by mauri.me...@gmail.com
on 20 Feb 2012 at 7:00
That's an option already by configuring the client to not redistribute. There's
an option for cancellation. See the ConnectionFactoryBuilder and it's usage
for details.
Original comment by ingen...@gmail.com
on 20 Feb 2012 at 7:09
I want redistribute the key, but if no alternative node is available or
connected and primary is unavailable too then I want to cancel the operation.
Original comment by mauri.me...@gmail.com
on 20 Feb 2012 at 8:02
That is the behavior of the client. If there is no alternative and the primary
is unavailable, cancellation isn't necessary as the operation won't be sent
anywhere else. It'll generate garbage, but that garbage will be cleaned up.
Original comment by ingen...@gmail.com
on 16 Mar 2012 at 5:12
In this moment with a stress test the garbage is not cleaned up and the client
crash with an OutOfMemeryError. Try the test I attached.
Original comment by mauri.me...@gmail.com
on 16 Mar 2012 at 6:22
Original issue reported on code.google.com by
mauri.me...@gmail.com
on 19 Feb 2012 at 3:58