Load balance memcached?
I have question regarding norhtscale memcached I've setup 2 server for memcached cluster and I was wondering is it possible to used load balancer on this 2 memcached server? I'm currently using haproxy.
192.168.0.10 -- virtual ip for memcached
192.168.0.20 - server 1
192.168.0.21 - server 2
If I shutdown server 1 would all cache data will be lost? or it will be on stay on server 2?
I see... how about load balancing?
I am sorry - I did not understand your question. But, by what I understand -once server1 fails then all the requests meant for server1 will keep on coming to server1 and you will probably get a timeout. If your load balancer can start sending all the requests to server2 when server1 fails then that is what would happen.
There is no automatic failover - if that is what you meant.
Please let me know if yu have more questions.
Thanks
Bhawana
I am sorry - I did not understand your question. But, by what I understand -once server1 fails then all the requests meant for server1 will keep on coming to server1 and you will probably get a timeout. If your load balancer can start sending all the requests to server2 when server1 fails then that is what would happen.
There is no automatic failover - if that is what you meant.
Please let me know if yu have more questions.
Thanks
Bhawana
As what I understand that if server 1 shutdown all data will be lost and it will not keep to server 2, this is fine with me... I tried to investigate to check both server 1 and server 2 admin page and I see both has same memcached data. So What I have in mind is to used haproxy to load balance request to 1 server and server 2 in that way I could you both 2 server instead of 1 server only.
I have here a current configuration on haproxy but seems not working.
########################################################
# Memcached Cluster Config and load balancing #
########################################################
frontend memcached
bind 192.168.0.101:11211
default_backend memcached_cluster
backend memcached_cluster
mode tcp
balance roundrobin
##stats enable
##option mysql-check
##option tcpka
##option httpchk
server node1 192.168.0.72:11211 check inter 5s rise 2 fall 2
server node1 192.168.0.71:11211 check inter 5s rise 2 fall 2
thanks for the help I got it all working....
using above haproxy configuration, and roundrobin to 2 servers I've observe memcached request is slow. I've tried to point again to 1 server I get the speed I need with requesting to memcached server... I have difference of 7secs request using firebug to check page loading.
Hello,
This is how I understand this. Let me know if I am wrong here:
You have two web servers. (W1 and W2)
You have two membase nodes with memcached only buckets. (N1 and N2)
The web servers co-exist with the memcached node. (W1 and N1, W2 and N2)
You have HAProxy load balancer in front of the two web servers so that your request gets routed to the web servers in a round-robbin fashion.
Now, when you send a request to the web server (via the load balancer) , you see that the request latency is high when you have both N1 and N2 present as compared to when you have just N1. - Correct?
Let me know if this is what you mean and correct me if I have something missing here.
Bhawana
yes your correct...
When you say that there is a latency difference of 7 secs - do you mean that it takes 7 seconds more to load the page with one server compared to the time it takes to load the same page when you use 2 servers? Is the behaviour consistent over hundreds of requests or it depends on not hitting the webserver on which the data lives? For instance, the data to be retrieved is on N2 and the request is sent to W1 webserver.
Can you please try timing the mecache requests in both the deployments (one server and two)
Thanks
Bhawana
I'm still checking on this I'll give you feeback about.. .as of now I'm having problem accessing the web console as I forgot my username and password, I lost my laptop and notes... I'm looking for a solution to be able to retrieve it via remote ssh.
You can try this if you have access to the machine:
If you have access to the config.dat file, here are instructions to recover the password:
$Membase_dir/erlang-13b03/bin/erl -noinput -eval 'case file:read_file("./config.dat") of {ok, B} -> io:format("~p~n", [binary_to_term(B)]) end.' -run init stop | grep creds
Bhawana
memcached does not have any persistence, so if you shut down a server you would lose all data on that server.
-bhawana
Forum support is great for free but sometimes you need a guaranteed response time and dedicated resources for your questions or issues.
Consider purchasing enterprise-level support from Membase: http://www.membase.com/products-and-services/overview
Call or email "sales -at- membase -dot- com" today!