Starling Protocol Bug in STATS Response

The memcache protocol requires that all lines in the server response end with CRLN (rn). The Starling server doesn’t strictly obey this for the STATS command. The fix is trivial and the author has been notified of the fix.

Edit lib/starling/handler.rb and add the following gsub right before .freeze in the STATS_RESPONSE:

%sENDrn”.gsub(/r?n/, “rn”).freeze

And the same for QUEUE_STATS_RESPONSE:
STAT queue_%s_expired_items %dn”.gsub(/r?n/, “rn”).freeze

No related posts.

2 comments

  1. Dieter_be says:

    Hi,

    I never heard of Starling (until now) but you could check if it supports the memcached binary protocol. Using this protocol (developed by the facebook guys iirc) is easier on your cpu's.

    Really like your blog btw (came here searching for a php class for mogileFS )

  2. e says:

    No, it does not support the binary protocol or UDP. It's open source, however, so it doesn't prevent someone else from implementing it.

    I would start off with seeing how well it performs for you. We're able to do a couple thousand inserts per second on a slow machine (ec2 m1.small instance).

    Also note, the current version of Starling in git has fixed the bug mentioned in this post.

Leave a Reply

Your email address will not be published. Required fields are marked *

*