Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are there support memcached binary protocols? #303

Open
dph5199278 opened this issue Sep 16, 2022 · 12 comments
Open

Are there support memcached binary protocols? #303

dph5199278 opened this issue Sep 16, 2022 · 12 comments
Labels
bug Something isn't working minor nice to have enhancement

Comments

@dph5199278
Copy link

dph5199278 commented Sep 16, 2022

Describe the bug
When I use text protocols, everything is ok. But when I use binary mode, the program will report an error.

To Reproduce

  1. Use xmemcached binary protocols to connect dragonfly
  2. Use set methot
  3. See error

Expected behavior
work to ok.

Screenshots
image

Environment (please complete the following information):

  • Containerized: Docker, Docker Compose
  • Dragonfly Version: 0.6.0

Reproducible Code Snippet

XMemcachedClientBuilder builder = new XMemcachedClientBuilder(AddrUtil.getAddresses("127.0.0.1:11211"));
// use binary protocols
builder.setCommandFactory(new BinaryCommandFactory());
// set method
builder.build().set(key, 0, value);
@dph5199278 dph5199278 added the bug Something isn't working label Sep 16, 2022
@romange
Copy link
Collaborator

romange commented Sep 16, 2022

indeed, we have not implement memcached binary support yet.

@dph5199278
Copy link
Author

dph5199278 commented Sep 16, 2022

indeed, we have not implement memcached binary support yet.

Are there any plan to support binary protocols? thanks

@romange
Copy link
Collaborator

romange commented Sep 16, 2022

Yes, we have plans. Pls dm me at discord or send me an email - I would like to understand your use case better before prioritizing this task.

@dph5199278
Copy link
Author

Yes, we have plans. Pls dm me at discord or send me an email - I would like to understand your use case better before prioritizing this task.

memcached-test.zip

This is my complete use case.
Thanks.

@romange
Copy link
Collaborator

romange commented Sep 16, 2022

I am not talking about a reproducible test, I am talking about your system in general. Why do you use memcache in 2022 when writing a new code and cetera.

@dph5199278
Copy link
Author

I am not talking about a reproducible test, I am talking about your system in general. Why do you use memcache in 2022 when writing a new code and cetera.

: ) In my case

  1. I am not use memcached for my new code
  2. There are many old systems that use memcached, I want to compare Memcached with Dragonfly to see whether the cost can be reduced for migration.
  3. redis is different from its interfaces, and the migration cost is high

Thanks.

@romange
Copy link
Collaborator

romange commented Sep 16, 2022

Ok, so it's actually an interesting use-case for us and this is why I wanted to chat with you. You prefer talking here? Discord is faster...

@dph5199278
Copy link
Author

Ok, so it's actually an interesting use-case for us and this is why I wanted to chat with you. You prefer talking here? Discord is faster...

Yes, I never used Discord, so this is better : )

@romange
Copy link
Collaborator

romange commented Sep 16, 2022

ok,

  1. what's the size of your memcached cluster? are you throughput constrained? memory bounded?
    what would be the decisive factor for you to switch to DF i.e. what's the cost difference that would cause the flip?

  2. Can you check with text-based protocol and decide whether it's more cost efficient for you without binary protocol support? And then if yes, we can prioritize the feature?

my email is roman -at- dragonflydb.io - feel free to reach out there (I hope you used email before 😉 )

@dph5199278
Copy link
Author

dph5199278 commented Sep 16, 2022

what's the size of your memcached cluster? are you throughput constrained? memory bounded?
what would be the decisive factor for you to switch to DF i.e. what's the cost difference that would cause the flip?

  1. Dragonfly supports the interface between Redis and Memcached, and the data is interoperable
  2. The dictionary data of the old system takes a lot of time to access for the first time after the memcached is restarted
  3. The old system uses Memcached for session synchronization, which has a large amount of data and uses the binary protocol for higher performance

Can you check with text-based protocol and decide whether it's more cost efficient for you without binary protocol support? And then if yes, we can prioritize the feature?

Prioritize other features, because the old system has been running for a long time. For performance, stability is the priority, so we can wait for your binary protocol support.

: ) Thanks! I send same email too.

@alphabet5
Copy link

(I think) we're looking for support of binary protocols too.

This is an example get request,

Memcache Protocol, Get Key Request
    Magic: Request (128)
    Opcode: Get Key (12)
    Key Length: 35
    Extras length: 0
    Data type: Raw bytes (0)
    Reserved: 0
    [Value length: 0]
    Total body length: 35
    Opaque: 65536
    CAS: 0
    Key: my-modified-key-name

Memcached responds with a normal result / key not found response, but dragonfly there is only a tcp ack, and then nothing else is sent - causing the client to log error 31 (timeout), and send the fin/rst after the configured timeout (5s in our case).

It would be helpful for the server to respond with something more helpful, maybe 28 = MEMCACHED_NOT_SUPPORTED ?

@romange
Copy link
Collaborator

romange commented Apr 12, 2024

how can I send a binary request easily?

@chakaz chakaz added the minor nice to have enhancement label Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working minor nice to have enhancement
Projects
None yet
Development

No branches or pull requests

4 participants