Mike Perham

On Ruby, software and the Internet

Starling and a reliable Memcached client

May 29th, 2008 · 8 Comments

We moved part of our FiveRuns Manage infrastructure to use Starling this week. I’m rapidly becoming a convert as it has proven to be simple, fast and reliable. The Starling 0.9.3 release is somewhat long in the tooth but GitHub has several Starling forks which contain performance improvements and bugfixes, including our own fiveruns/starling fork. Our fork has proven to be about 3 times faster than 0.9.3 in raw message processing speed.

More elusive has been the client library to use with Starling. Because Starling just uses the memcached protocol, any memcached client should be able to use Starling. The problem is that the most popular memcached client, Seattle.rb’s memcache-client library, has several bugs in the latest 1.5.0 version:

  1. set() fails when the socket has been disconnected (via Twitter)
  2. it does not retry if a socket operation fails (via Will Bryant)
  3. it does not retry the current operation on another server if a server dies

The first two I fixed by applying the patches at the links above. The last one I found and fixed myself – it’s critical for fault tolerance. We run two Starling servers for redundancy and if one goes down, we wanted the clients to transparently fail over to the other. All three bugs have been fixed in our fiveruns/memcache-client project. If you use our client, please let me know. I’d love to hear success stories!

Tags: Ruby

8 responses so far ↓

  • 1 Blaine Cook // May 29, 2008 at 6:01 pm

    Hey! Be fair! You just took out the fsync() call. :-p

    Very awesome to see you guys hacking on this, and I promise by the end of the week these changes will be rolled into Starling the Rubyforge-gem.

  • 2 mperham // May 29, 2008 at 6:31 pm

    Blaine, I didn’t mean to take credit for the Starling speedup. Our Starling project is a fork based on the work of several other people. We haven’t changed a line of Ruby code. Chris W’s evented changes were also important for us to get.

  • 3 Starling: A Ruby Persistent Queue Server That Speaks Memcached // Jul 21, 2008 at 7:29 pm

    [...] ticking over. Starling is proven in production, with not only Twitter using it in anger, but FiveRuns too. FiveRuns have even created their own fork that, they say, is significantly [...]

  • 4 Starling: A Ruby Persistent Queue Server That Speaks Memcached - 二分之一追赶 - 程序 生活 // Jul 28, 2008 at 3:35 am

    [...] Starling是一个’使用MemCache协议的,轻量级的消息队列服务器,从它被开发至今已经有一段时间了。Starling使得为 多个进程和多个主机之间的并行作业编写一个可通过网络访问的消息队列(或多个消息队列),变得极其容易。Starling由Twitter开发,并用于处理其系统内的产生的大量的消息队列。Starling 在实际应用中已经得到了验证,并且不仅仅只有Twitter自己在使用,另一家公司FiveRuns也在使用Starling。FiveRuns 甚至创建了他们自己的Starling 版本 ,按照他们的说法,Starling是非常快速的。 [...]

  • 5 Carl Mercier // Oct 11, 2008 at 10:03 am

    Is your fork still “the best one” out there? This article is almost 5 months old: light years when it comes to tech!

  • 6 mperham // Oct 11, 2008 at 11:02 am

    Carl, our memcache-client is still the best afaik. Our starling fork is no longer maintained. You should be using http://github.com/starling/starling.

    Even Weaver recommends his memcached wrapper. You might want to check it out too. http://github.com/fauna/memcached/tree/master

  • 7 Carl Mercier // Oct 11, 2008 at 12:18 pm

    Good to know, thanks!

  • 8 links for 2008-10-20 « Caiwangqin’s delicious bog // Oct 20, 2008 at 5:14 pm

    [...] Starling and a reliable Memcached client | Mike Perham (tags: starling memcache ruby) [...]

Leave a Comment