Memcached with Windows and .NET
Asked Answered
S

11

82

Is there anyone already implement memcached for production use in Windows environment? Because many blogs that I've read, it's not recommended to run memcached in Windows especially for production use, for example running memcached on windows.

And one more thing, which memcached client that is good to use with c# and .net 3.5 ? I've found many alternate such as Memcached Providers @ Codeplex, Beitmemcached, and memcached provider @ Sourceforge

Spondee answered 9/12, 2008 at 2:41 Comment(4)
You're pointing to a 2008 blog post. Memcached is becoming pretty friendly on windows lately: northscale.comRendering
+1 to Dustin. We have been using NorthScale and is quite windows friendly, with a nice admin (web) UIArielariela
@Rendering and @Arielariela - Dustin, enjoy your +1 but this question was asked in 2008.Burbot
Heh. That must be what that '08 is there. Sorry about that. :)Rendering
L
49

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

Lewak answered 9/12, 2008 at 12:8 Comment(6)
How does TCO rise exponentially on Windows? Licensing cost rises linearly with the number of machines. But when you take into hardware costs, rack space & electricity, support contracts, and operators salaries, the licensing cost of Windows is pretty insignficant, frankly.Pacifier
Just to add a rebuttal to Cherian's argument. A driving factor in wanting to host in windows can be sysadmin expertise. For example, smaller shops that don't have the resources to hire a *nix administrator just to bring up a memcached box could benefit greatly from hosting on a platform with which the company is already well versed in (ie. Windows).Puffball
i've been margin out the possibility of running Windows to process code with an memcached/oss server. lol. Thanks for the adviceIpsambul
I would DV this answer since it really doesn't address anything the OP asked however he said this was specifically what he was looking for.Transient
Downvoted because it doesn't address the actual question. If it solved the OP's problem, perhaps the question should be rewritten?Alizaalizarin
"Why get the Windows version?" --Local developmentUnderstructure
B
21

I'm suprised no one here has yet to mention Redis - it is one of the most feature-rich and fastest (110,000 SET's per second on an entry level linux box) key-value data stores with rich data-structure support for strings, sets, lists, sorted sets and hashes.

Although windows is not an officially supported platform, it runs perfectly under windows with all tests passing. I have windows builds (using Cygwin) available here: https://github.com/ServiceStack/ServiceStack.Redis#redis-server-builds-for-windows

It also has client bindings for nearly every programming language in use today. I maintain a rich Open Source C# Redis client with native API support for any C# POCO type, transaction support and Thread-safe client managers that are ready to be dropped into any IOC at: https://github.com/ServiceStack/ServiceStack.Redis

Bal answered 31/3, 2010 at 18:51 Comment(0)
C
12

Since Velocity didn't exist at the time, I used a memcached port to Windows for the company that I work for, Skiviez. It mainly only exists to provide a centralized cache for multiple worker processes on the same machine. It's been running fine about 18 months now on an e-commerce site that sees modest use (~18,500 hits/day). The client that I used was Enyim integrated as a cache provider for iBATIS.NET. That client seems to work well enough; memcached clients are not very complicated to begin with, either.

If I had to do it again, I'd probably look at Velocity if I was committed to remaining on Windows for my distributed caching solution. But it's working now, so I'm not going to touch it.

(Aside: Since then, I negated most of the need for the cache by adding certain Cache* columns to key tables in the database that are updated by a scheduled task every evening. This ended up putting much less strain on resources all around, from the initial hit in CPU time by querying the database to the subsequential strain on memory availability by keeping the cached results sitting in memcached. It also made it much more explicit in the code when a cached version of the data is being accessed versus a calculated-on-the-fly version. I'm sure you have lots of reasons to use a distributed cache, but it's always worth a shot to take a step back and question whether or not you really need it!)

Cuspidor answered 11/7, 2009 at 1:30 Comment(1)
Velocity is now part of AppFabricCatto
S
7

i don't know what the project you're working on is, but you might like to take a look at the Microsoft Velocity project From the page:

"Velocity" is a distributed in-memory application cache platform for developing scalable, high-performance applications. "Velocity" can be used to cache any common language runtime (CLR) object and provides access through simple APIs. The key aspects of "Velocity" are distributed cache performance, scalabily, and availability.

I've seen a couple of demo's and it looks like it has really nice integration with .net framework.

The problem with the client API's is that you still have to have an instance of memcached running on another box somewhere preferrably as you've noted, using the LAMP stack. Using velocity means you're still going to be running on the same stack and there's tighter integration across the .net platform.

Having said that, if you want to use velocity as a cache for other .net applications you might find yourself having to write your own API to expose the velocity data for consumption.

Sought answered 9/12, 2008 at 2:50 Comment(3)
As far as I know, velocity still under development, that's why I try to search other alternate. And that is memcachedSpondee
after I read a while, velocity installation and maintainance is not easy as memcachedSpondee
Using the LAMP Stack? Don't you mean "using Linux" since you don't need Apache, MySQL or PHP to run memcached.Radbun
A
6

Velocity is a bit more involved to administer, but it is far, far more powerful then memcached. I am not anti-memcached, not in the least bit, it is great. But moving forward, new projects that are pure .NET based are crazy not to leverage Velocity, even in its current unreleased state.

Ab answered 29/12, 2008 at 17:52 Comment(0)
S
6

have a look at SharedCache. its open source, easy to use and very reliable.

high-performance, distributed memory object caching system, generic in nature, but intended to speeding up dynamic web and / or win applications by alleviating database load. Don't forget to visit us at http://www.sharedcache.com

Suffocate answered 11/7, 2009 at 7:2 Comment(0)
P
3

The problem with the client API's is that you still have to have an instance of memcached running on another box somewhere preferrably as you've noted, using the LAMP stack.

Not at all true. The LAMP (Linux, Apache, MySQL, PHP) stack is not required to run Memcached. I currently prefer memcached over velocity until velocity is out of CTP. I've played around with velocity for a bit but found it too unwieldy. I follow that whole KISS thing, you know... keep it simple. Nothing simpler than caching... Get(key)... Put(key, value)... Destroy(Key).

Pyuria answered 24/2, 2009 at 23:19 Comment(0)
F
1

I know I'm a little late to the party here, and there are already tons of good answers.

We've used Membase on Windows Server with great success. It is 100% compatible with Memcached, and has a nice GUI installer and web configuration server build it. It is extremely easy to administer.

There are also other NoSQL features included, which are outside the scope of this thread, but worth looking at. They do have a free license for development, testing, and (limited) production servers.

Membase Downloads

That same page has a Windows Install for Memcached only, if you don't want any of the extra features in Membase.

Forelock answered 23/9, 2011 at 17:17 Comment(0)
B
1

Please follow the links mentioned below to see the solution for this question.

I could implement the memcached for production use in windows environment.

http://www.codeproject.com/Articles/96698/Implementing-Distributed-Caching-using-Memcached http://www.deanhume.com/Home/BlogPost/object-caching----net-4/37 http://latebound.blogspot.com/2008/10/using-memcached-from-c.html

Bobinette answered 16/8, 2012 at 11:36 Comment(0)
P
0

If you're interested in running a memcached client on Windows then there are two additional open source servers that can do the job. Both implement the standard memcached server protocol and are written in Java so they run on Windows.

Polyphagia answered 13/1, 2012 at 15:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.