Is There a Port of Memcache to .Net

Is there a port of memcache to .Net?

Windows Server ports:

  • memcached for Win32
  • Jellycan Code - memcached

Memcached .NET Client ports:

  • memcacheddotnet
  • enyim.com Memcached Client
  • BeIT

Is there a port of memcache to .Net?

Windows Server ports:

  • memcached for Win32
  • Jellycan Code - memcached

Memcached .NET Client ports:

  • memcacheddotnet
  • enyim.com Memcached Client
  • BeIT

How do I see if memcached is already running on my chosen port?

Try

netstat -ap | grep TheChosenPort#

and see if anything is listening on those TCP or UDP ports.

Memcached with Windows and .NET

Why do you need to run memcached on windows? It’s an expensive affair in a production environment.

If your code needs to run in a Windows environment get a windows memcached client and talk to a *nix based memcached machine.

In a production environment running memcached on Server 2003 or 2008 would mean that you get licenses for all those boxes. Linux will offer you all the OSS benefits. TCO will rise linearly with memcached on Windows

Edit:

It’s been around 1.5 years since I wrote this answer and lot of things have changed since. You’ve to take notice, especially when someone like Dustin comments.

So here’s how you can get memcached on windows running. Download memcached for windows from Couchbase (formerly Northscale).

Typically if you plan to run memcached on the same production machine you’d want to start it in limited memory, i.e. define the maximum memory memcached is allowed to use.

c:\Program
Files\memcached>memcached.exe -m 128.

Here memcached runs with a maximum of 128 mb usage. You don’t want memcached to take up all the memory on your webserver.

The moment you decided to scale out memcached you’ll need to consider what I said earlier. Additionally compress your values in the key value combinations. Web servers typically consume very little CPU (2-3%) usage and compression brings in a lot of value to network throughout in comparison to the CPU usage. If you are too concerned about normal compression, try LZO

Which .NET Memcached client do you use, EnyimMemcached vs. BeITMemcached?

We tested both and found Enyim to perform the best for our expected usage scenario: many (but not millions) cached objects, and millions of cache-get requests (average web site concurrency load = 16-20 requests.)

Our performance factor was measuring the time from making the request to having the object initialized in memory on the calling server. Both libraries would have sustained the job, but the enyim client was preferred in our testing.

memcached limitations

I can give you some metrics for our environment. We run memcached for Win32 on 12 boxes (as cache for a very database heavy ASP.NET web site). These boxes each have their own other responsibilities; we just spread the memcached nodes across all machines with memory to spare. Each node had max 512MB allocated by memcached.

Our nodes have on average 500 - 1000 connections open. A typical node has 60.000 items in cache and handles 1000 requests per second (!). All of this runs fairly stable and requires little maintenance.

We have run into 2 kinds of limitations:
1. CPU use on the client machines. We use .NET serialization to store and retrieve objects in memcached. Works seamless, but CPU use can get very high with our loads. We found that some object can better be first converted to strings (or HTML fragments) and then cached.
2. We have had some problems with memcached boxes running out of TCP/IP connections. Spreading across more boxes helped.

We run memcached 1.2.6 and use the .NET client from http://www.codeplex.com/EnyimMemcached/



Related Topics



Leave a reply



Submit