Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Membase | Memcached Server 1.0.3

Load balance memcached?

11 replies [Last post]
  • Login or register to post comments
Mon, 11/29/2010 - 18:41
t0kneneng
Offline
Joined: 11/29/2010
Groups: None

 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?

Top
Tue, 11/30/2010 - 16:32
bhawana@membase
Offline
Joined: 10/29/2010
Groups: None

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!

Top
Tue, 11/30/2010 - 17:04
t0kneneng
Offline
Joined: 11/29/2010
Groups: None

 I see... how about load balancing? 

Top
Wed, 12/01/2010 - 13:31
bhawana@membase
Offline
Joined: 10/29/2010
Groups: None

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

__________________

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!

Top
Wed, 12/01/2010 - 18:19
t0kneneng
Offline
Joined: 11/29/2010
Groups: None

bhawana@membase wrote:

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

 

 

 

 

Top
Wed, 12/01/2010 - 18:19
t0kneneng
Offline
Joined: 11/29/2010
Groups: None

thanks for the help I got it all working....

Top
Wed, 12/01/2010 - 20:40
t0kneneng
Offline
Joined: 11/29/2010
Groups: None

 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.

Top
Thu, 12/02/2010 - 12:24
bhawana@membase
Offline
Joined: 10/29/2010
Groups: None

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

 

 

__________________

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!

Top
Sun, 12/05/2010 - 21:57
t0kneneng
Offline
Joined: 11/29/2010
Groups: None

 yes your correct...

Top
Mon, 12/06/2010 - 10:49
bhawana@membase
Offline
Joined: 10/29/2010
Groups: None

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

__________________

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!

Top
Tue, 12/07/2010 - 06:09
t0kneneng
Offline
Joined: 11/29/2010
Groups: None

 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.

Top
Tue, 12/07/2010 - 13:42
bhawana@membase
Offline
Joined: 10/29/2010
Groups: None

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

__________________

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!

Top
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker