Skip to content
This repository was archived by the owner on Nov 2, 2021. It is now read-only.
This repository was archived by the owner on Nov 2, 2021. It is now read-only.

Feature Request: Support for Dalli/Rails #11

Closed

Description

@benubois

It would be great if this could work with Rails and I think for that to happen this would have to work with the Dalli gem. Currently when trying to perform any memcached operations an exception occurs:

require 'dalli'
dc = Dalli::Client.new('localhost:11211')
dc.set('abc', 123)

method server_for_key in ring.rb at line 45
method perform in client.rb at line 347
method set in client.rb at line 199

log from fatcache:

[Fri Sep  6 05:56:01 2013] fc_server.c:87 accepted c 7 on s 6
[Fri Sep  6 05:56:01 2013] fc_memcache.c:785 parsed bad req 12 res 1 type 0 state 0
00000000  80 0b 00 00 00 00 00 00  00 00 00 00 00 00 00 00   |................|
00000010  00 00 00 00 00 00 00 00                            |........|
[Fri Sep  6 05:56:01 2013] fc_core.c:81 recv on c 7 failed: Invalid argument
[Fri Sep  6 05:56:01 2013] fc_core.c:113 close c 7 on event 0005 eof 0 done 0 rb 24 sb 0: Invalid argument
[Fri Sep  6 05:56:01 2013] fc_client.c:64 close c 7 discarding pending req 12 len 24 type 0

Activity

  1. manjuraj commented on Sep 22, 2013

    @manjuraj
    Contributor

    @benubois could you paste the log file by running fatcache with log level 9 (-v 9)

  2. benubois commented on Sep 22, 2013

    @benubois
    Author

    Certainly, here it is:

    [Sun Sep 22 22:13:41 2013] fc_core.c:145 event 0001 on 6
    [Sun Sep 22 22:13:41 2013] fc_util.c:573 malloc(120) at 0xa8f970 @ fc_connection.c:180
    [Sun Sep 22 22:13:41 2013] fc_connection.c:239 get conn 0xa8f970 c 7
    [Sun Sep 22 22:13:41 2013] fc_server.c:87 accepted c 7 on s 6
    [Sun Sep 22 22:13:41 2013] fc_server.c:45 accept on s 6 not ready - eagain
    [Sun Sep 22 22:13:41 2013] fc_core.c:145 event 0005 on 7
    [Sun Sep 22 22:13:41 2013] fc_util.c:573 malloc(224) at 0xa8f9f0 @ fc_message.c:57
    [Sun Sep 22 22:13:41 2013] fc_message.c:124 get msg 0xa8f9f0 id 1 request 1 owner sd 7
    [Sun Sep 22 22:13:41 2013] fc_util.c:573 malloc(8192) at 0xa8fae0 @ fc_mbuf.c:46
    [Sun Sep 22 22:13:41 2013] fc_mbuf.c:99 get mbuf 0xa91ab0
    [Sun Sep 22 22:13:41 2013] fc_mbuf.c:199 insert mbuf 0xa91ab0 len 0
    [Sun Sep 22 22:13:41 2013] fc_connection.c:63 recv on sd 7 24 of 8144
    [Sun Sep 22 22:13:41 2013] fc_memcache.c:785 parsed bad req 1 res 1 type 0 state 0
    00000000  80 0b 00 00 00 00 00 00  00 00 00 00 00 00 00 00   |................|
    00000010  00 00 00 00 00 00 00 00                            |........|
    [Sun Sep 22 22:13:41 2013] fc_core.c:81 recv on c 7 failed: Invalid argument
    [Sun Sep 22 22:13:41 2013] fc_core.c:113 close c 7 on event 0005 eof 0 done 0 rb 24 sb 0: Invalid argument
    [Sun Sep 22 22:13:41 2013] fc_client.c:64 close c 7 discarding pending req 1 len 24 type 0
    [Sun Sep 22 22:13:41 2013] fc_message.c:141 put msg 0xa8f9f0 id 1
    [Sun Sep 22 22:13:41 2013] fc_mbuf.c:208 remove mbuf 0xa91ab0 len 24
    [Sun Sep 22 22:13:41 2013] fc_mbuf.c:121 put mbuf 0xa91ab0 len 24
    [Sun Sep 22 22:13:41 2013] fc_connection.c:162 put conn 0xa8f970
    
  3. manjuraj commented on Sep 22, 2013

    @manjuraj
    Contributor

    looks like the Dalli is trying to use binary protocol (https://github.com/mperham/dalli). fatcache only supports memcache ascii protocol.

  4. manjuraj commented on Sep 23, 2013

    @manjuraj
    Contributor

    closing this for now. feel free to reopen if you have questions

  5. benubois commented on Jan 16, 2014

    @benubois
    Author

    @manjuraj,

    Makes sense, but I keep coming back to this project as memcached on SSD is such a great idea.

    I think it would be a great feature and would make fatcache immediately useful to anyone using Rails.

    Any thoughts on what it would take to support the binary protocol?

  6. manjuraj commented on Jan 21, 2014

    @manjuraj
    Contributor

    There is an implementation of binary memcache in the twemproxy project (twitter/twemproxy@f2ffca7). See twemproxy, branch - binary_memcache.

    I believe it would be trivial to port this over to fatcache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions