killme2008 / xmemcached

High performance, easy to use multithreaded memcached client in java.
http://fnil.net/xmemcached
Apache License 2.0
757 stars 280 forks source link

DNS changes requires reinstantiating xmemcached client #49

Closed flozano closed 8 years ago

flozano commented 8 years ago

If a memcached server is restarted and gets a different IP address when recovering, the xmemcached client will never notice of that (as the name is resolved by the builder constructor):

    public XMemcachedClientBuilder(String addressList) {
        this(AddrUtil.getAddresses(addressList));
    }

This is a very serious limitation in many dynamic envs (eg: AWS).

killme2008 commented 8 years ago

Hmm.. It's a problem in such environment. But memcached is so high reliable, restart is not a common operation.

I will try to find some way to solve this problem, but it does not have high priority,Thanks.

flozano commented 8 years ago

Restart of cache nodes is becoming very common in Amazon AWS, and Amazon is a very popular platform... I can see this is not an interesting problem to solve, but I am not sure that assessment about the priority is correct.

killme2008 commented 8 years ago

Hi, may i ask why do you often restart memcached instances?

We are using memached in AWS too, but the instances keep running almost 2 years without any operations.

If you want to clear all items in memcached, i think flush_all command is a better choice.

flozano commented 8 years ago

Hi. Maybe I didn't explain correctly. Elasticache's Memcached instances are restarted not by me, but by Amazon AWS itself.

The reasons when Amazon does it are:

killme2008 commented 8 years ago

Hi. Thanks, i see. Because we are not using AWS memcached instances but starting memcached processes by ourself, so we don't have this problem right now.

I will try to figure out a way to solve the problem.

flozano commented 8 years ago

Thanks a lot for reconsidering!

killme2008 commented 8 years ago

@flozano Hi, i released 2.1.0 yesterday, you can try it when you are free.

flozano commented 6 years ago

Just FYI, we keep having this problem.

killme2008 commented 6 years ago

Have you upgrade xmc to 2.1.0 or latest version?

flozano commented 6 years ago

We're using 2.4.0

Francisco A. Lozano

2017-12-21 12:21 GMT+01:00 dennis zhuang notifications@github.com:

Have you upgrade xmc to 2.1.0 or latest version?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/killme2008/xmemcached/issues/49#issuecomment-353326855, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGwe2xPepC0naZ9Yjmbn2EFUsOHzn6eks5tCj8sgaJpZM4J6UnS .

flozano commented 6 years ago

Reported as https://github.com/killme2008/xmemcached/issues/68