Re: Load-balanced web-servers + memcached

2008-10-31 Thread TheJonathan
I followed everyone's suggestions in here and didn't use localhost after-all. web1 and web2 both use the server settings: 192.168.1.1 and 192.168.1.2 (in that order). Works like a charm ;) On Oct 31, 9:55 am, "Clint Webb" <[EMAIL PROTECTED]> wrote: > Are you sure?  When hashing the key, to det

Re: Load-balanced web-servers + memcached

2008-10-31 Thread Clint Webb
Are you sure? When hashing the key, to determine which server to send it to, on some machines it will put key 'foo' on server web3, but on web3 it will put it on localhost? It just doesn't seem like good practice to me to access a member of a cluster by using localhost, when other clients will be

Re: Load-balanced web-servers + memcached

2008-10-31 Thread TheJonathan
On Oct 31, 6:48 am, "Henrik Schröder" <[EMAIL PROTECTED]> wrote: > This is not the .Net client you are looking for, you want use my > client:http://code.google.com/p/beitmemcached. You are feeling very sleepy, > and > very swayed! :-) Must...use...BeIT Memcached. *drool* To be fair, I'm curre

Re: Load-balanced web-servers + memcached

2008-10-31 Thread Henrik Schröder
On Thu, Oct 30, 2008 at 9:26 PM, TheJonathan <[EMAIL PROTECTED]> wrote: > > I think I get it. So if I'm passing in the array of memcached IPs via > a web.config, make sure they are in the same order on all load- > balanced machines. e.g. > web1 = localhost, web2 > web2 = web1, localhost > As lo

Re: Load-balanced web-servers + memcached

2008-10-31 Thread Simone Busoli
memcached is extremely fast. We're using it as a second level cache, level one being in-memory cache (System.Web.Caching.Cache), and we can hardly notice any performance difference. On Fri, Oct 31, 2008 at 5:06 AM, TheJonathan <[EMAIL PROTECTED]> wrote: > > Thanks for everyone's help! I just swi

Re: Load-balanced web-servers + memcached

2008-10-30 Thread TheJonathan
Thanks for everyone's help! I just switched over my sessions across the load-balanced servers to memcached and it worked perfectly. I think the pages even load a little faster without the extra hits to the database on every page. Can't wait to see how this affects performance during peak traffi

Re: Load-balanced web-servers + memcached

2008-10-30 Thread Clint Webb
Seconded. I would definately NOT use localhost in your configs, or your scripts. Be specific and you will save yourself some confusing problems. On Fri, Oct 31, 2008 at 5:27 AM, Simone Busoli <[EMAIL PROTECTED]>wrote: > On Thu, Oct 30, 2008 at 9:26 PM, TheJonathan <[EMAIL PROTECTED]> wrote: > >>

Re: Load-balanced web-servers + memcached

2008-10-30 Thread Kevin Amerson
Exactly, yes, we use the Enyim client and it has the hashing built in. You could sub it out if you wanted to, but it works well out of the box ;). On Thu, Oct 30, 2008 at 4:39 PM, Ray Krueger <[EMAIL PROTECTED]> wrote: > > > I think I get it. So if I'm passing in the array of memcached IPs via

Re: Load-balanced web-servers + memcached

2008-10-30 Thread Ray Krueger
> I think I get it. So if I'm passing in the array of memcached IPs via > a web.config, make sure they are in the same order on all load- > balanced machines. e.g. > web1 = localhost, web2 > web2 = web1, localhost > > @Kevin: Is the hashing algorithm you mentioned something I would have > to imp

Re: Load-balanced web-servers + memcached

2008-10-30 Thread Simone Busoli
On Thu, Oct 30, 2008 at 9:26 PM, TheJonathan <[EMAIL PROTECTED]> wrote: > web1 = localhost, web2 > web2 = web1, localhost > This would be better: web1 = web1, web2 web2 = web1, web2 This way, you can keep the same configuration on all clients.

Re: Load-balanced web-servers + memcached

2008-10-30 Thread TheJonathan
I think I get it. So if I'm passing in the array of memcached IPs via a web.config, make sure they are in the same order on all load- balanced machines. e.g. web1 = localhost, web2 web2 = web1, localhost @Kevin: Is the hashing algorithm you mentioned something I would have to implement myself,

Re: Load-balanced web-servers + memcached

2008-10-30 Thread Henrik Schröder
When you setup the client in your web app, you give it the same config on both machines, for example that memcached exists on "web1" and "web2" in your case. It's important that you name the servers in the same way and in the same order on all machines, otherwise the clients will distribute your ke

Re: Load-balanced web-servers + memcached

2008-10-30 Thread Kevin Amerson
The client should use a hashing algorithm on the key, and if both instances of memcached are in the available pool of servers, then once hashed, it will decide on the server and then always go to that server, unless of course it is taken out of the pool of available servers. You can test this out

Re: Load-balanced web-servers + memcached

2008-10-30 Thread Ray Krueger
Yes http://www.socialtext.net/memcached/index.cgi?faq On Thu, Oct 30, 2008 at 12:58 PM, TheJonathan <[EMAIL PROTECTED]> wrote: > > Hi all, > > I'm really excited to start using memcached. I'm currently using in- > memory caches in my ASP.NET+IIS6 application on 2 load-balanced > servers, but of

Load-balanced web-servers + memcached

2008-10-30 Thread TheJonathan
Hi all, I'm really excited to start using memcached. I'm currently using in- memory caches in my ASP.NET+IIS6 application on 2 load-balanced servers, but of course that isn't a shared memory between the 2 servers. So if key "test1" is cached on web1, web2 has no way of getting to it. Enter mem