Memcached with Windows and .Net

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

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

Memcached Client for .NET/C# - what are the pros and cons of each?

Found the answer

https://github.com/enyim/EnyimMemcached

Seems to be the only C# Memcache Client in active development (the Memcached wiki page is very out of date)

Enyim seems to be the most feature rich client and is also the most feature rich:

http://sysdot.wordpress.com/2011/03/08/memcached-clients-which-ones-best/

What is the ASP.NET equivalent to memcached in PHP?

Memcached works well with .net too, but equivalent would be Velocity

MS Velocity vs Memcached for Windows?

We have done recently a fair amount of comparing of Velocity and Memcached. In the nutshell, we found Velocity to be 3x - 5x slower than Memcached, and (even more crucially) it does not have currently support for a multi-get operation. So at the moment, I would recommend going with Memcached. Also, another lesson we have learned was that the slowest operation in distributed caching is serialization and deserialization (at least in ASP.NET). The in-process ASP.NET cache is order of magnitudes faster. So you have to choose caching strategies much more carefully.

Cache server for .NET(Example Memcached)

AppFabric is another popular solution from Microsoft.

Regarding caching data in win application c#

Memcache is a popular solution. There are some .NET ports:

Is there a port of memcache to .Net?

ASP.NET Data Caching? Memcache equivalent

You can use memcached also. There are also other alternatives. You may also check Scott Gu's post about the new cache extensibility model introduced in ASP.NET 4.0.

Can I get Memcached running on a Windows (x64) 64bit environment?

North Scale labs have released a build of memcached 1.4.4 for Windows x64:

http://blog.couchbase.com/memcached-windows-64-bit-pre-release-available

http://labs.northscale.com/memcached-packages/

UPDATE: they have recently released Memcached Server - still FREE but enhanced distro with clustering, web-based admin/stats UI etc. (I'm not related to them in any way) Check it out at http://northscale.com/products/memcached.html and download at: http://www.northscale.com/download.php?a=d

UPDATE 2: NorthScale Memcached is no longer available as a standalone download. Now they have made it part of their commercial No-SQL DB offering called Membase. It can be configured to run in Memcached-only mode (i.e. without persistence) and there's a 100% free version too. Check it out here: http://www.membase.org/downloads

UPDATE 3: MemBase has slept with CouchDB and produced a hybrid product offering, called CouchBase. They still do offer a free "Community" version at http://www.couchbase.com/download

Cache server for C# windows application

Using In memory cache, needs clear understanding of following use cases:

  1. Is it only a memory dump ?
  2. Does it needs Querying ability, like IQueryable, provided by the frameworks like Entity Framework for the Sql Server ?

If its only in memory dump then Redis, MemCache are fine, as they just store data in the memory as binary, de-serialized once fetched at the client location, which is not good if you are querying lots of data and want processing like filtering, sorting, pagination to be done at the source.

In case IQueryable processing is required, then check out ApacheIgnite.Net. Hazelcast and ScaleOut, out of them I find Apache Ignite to be most advanced, since it just doesn't support the Expression trees, via IQueryable, but also Ansi Sql, which is a very big advantage over other Cache

Also another point remains, why not replace Sql Server or similar database by a modern in memory system like VoltDB or Document db like Raven, as they are much faster, well integrated and completely exclude the need to separate Cache



Related Topics



Leave a reply



Submit