Coder Social home page Coder Social logo

Comments (25)

lcacciagioni avatar lcacciagioni commented on May 3, 2024 8

Is this issue closed? Binary protocol support will be great

from mcrouter.

erulabs avatar erulabs commented on May 3, 2024 7

It looks like PHP7 uses binary protocol for the memcached session handler by default these days. That means you get a pretty ugly error like:

Fatal Error: session_start(): Failed to create session ID: memcached

Since mcrouter doesn't support binary protocol, you'll need to tell PHP not to use it for sessions:

memcached.sess_binary_protocol = 0

So I'm betting this thread will get more and more visitors as people try to put PHP7 and Mcrouter together for the first time.

from mcrouter.

Ngo-The-Trung avatar Ngo-The-Trung commented on May 3, 2024 3

I'd like to take on this task

from mcrouter.

ndobromirov avatar ndobromirov commented on May 3, 2024 3

From experience the binary protocol allows for much higher performance (overall) compared to plain text one, mainly because you can then use compression on the data and keys you set in memcacheD instances.

From there you are greatly reducing:

  1. The cache storage needs of the system. As a plus-side, you can cache more on the same servers or cache the same with less, saving either further CPU cycles on application layer or some more money in the pocket.
  2. The network transfer times for cache reads, as the data is compressed and not a in plain text format it is usually around 10 times smaller (or more). This should improve network related delays and related bottlenecks.

The only problem is that client side will have some more overhead in CPU to consume the data, but that is usually negligible compared to the network delays to fetch it. Thus having compression for memcache is a net-positive performance-wise.

I am a huge +1 on having binary protocol supported in mcrouter. This will allow us to test and experiment with all of it's features. As it is at the moment, we can not use this software, as we depend on compression for our servers to run normally.

from mcrouter.

codyja avatar codyja commented on May 3, 2024 2

Would love to see Binary protocol supported as well. We use it for performance reasons too.

from mcrouter.

alikhtarov avatar alikhtarov commented on May 3, 2024 1

@renchap yes, the Umbrella protocol is something we use internally at Facebook. We don't want to document it in detail, since it probably won't be useful outside of Facebook, and we also want to have flexibility to change the format.
I like the idea of supporting the open source binary protocol, and it wouldn't be too difficult to implement. It would be ideal if we got a pull request for implementing this :)

from mcrouter.

nichochar avatar nichochar commented on May 3, 2024 1

Anyone with C++ skills want to tackle this? Maybe we can get some precisions on where in the codebase this change would happen, to make it easier for a contributor to start attacking the problem.

from mcrouter.

liyufu avatar liyufu commented on May 3, 2024

if the mcrouter currently supports the binary protocol now?
@renchap
if the binary protocol have a good performance to the ascii protocol?

from mcrouter.

liyufu avatar liyufu commented on May 3, 2024

@renchap

if the binary protocol have a good performance to the ascii protocol?

from mcrouter.

ryanmce avatar ryanmce commented on May 3, 2024

mcrouter does not currently support the memcached binary protocol. It does have a mcrouter-to-mcrouter binary protocol called umbrella, but memcached doesn't know how to parse it, so it's only useful in routing networks.

On Mar 7, 2015, at 3:03 AM, liyufu [email protected] wrote:

@renchap

if the binary protocol have a good performance to the ascii protocol?


Reply to this email directly or view it on GitHub.

from mcrouter.

amckinley avatar amckinley commented on May 3, 2024

Any updates on this? We need binary protocol support before we can use mcrouter.

from mcrouter.

alikhtarov avatar alikhtarov commented on May 3, 2024

@amckinley: hi, no updates at this time. By the way, could you share how the binary protocol helps in your case? We're actually evaluating whether to migrate from ASCII to binary internally for memcached - some things we can think of is slightly better parsing performance (due to known sizes), and reply/request matching (less parsing bugs).

from mcrouter.

cce avatar cce commented on May 3, 2024

We use the binary protocol because it seemed easier than worrying about ASCII-encoding binary keys like hashes or UTF-8 strings, and seemed faster as well for the reasons you mentioned. Would love to see support in mcrouter!

from mcrouter.

 avatar commented on May 3, 2024

Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.

from mcrouter.

mikeKBB avatar mikeKBB commented on May 3, 2024

we currently use the binary protocol with the enyim client, and we were hoping to plug in mcrouter to enable the replication and warm up features. But the ascii only support seems to be a major impediment.

we installed a mcrouter docker container, but on the initial tests the ascii items are timing out. is there some client tweak recommended or required other than specifying protocol is text?

from mcrouter.

barryhatfield avatar barryhatfield commented on May 3, 2024

+1

from mcrouter.

barryhatfield avatar barryhatfield commented on May 3, 2024

I was poking around in the latest version of the code (by no means am I an expert) and noticed some binary support stuff. Any update?

from mcrouter.

jmswen avatar jmswen commented on May 3, 2024

@barryhatfield, mcrouter supports a binary protocol (called Caret, if you see that word in our codebase) that has nothing to do with open-source memcached's binary protocol.

Unfortunately, at this point, we have no plans to add support for open-source memcached's binary protocol ourselves since we're happy with using Caret and ASCII internally. But, we would be willing to help guide anyone who wanted to contribute pull requests for open-source binary support.

from mcrouter.

andreazevedo avatar andreazevedo commented on May 3, 2024

@Ngo-The-Trung great!

Let us know if you need anything, we will be happy to help.

from mcrouter.

mujtabaahmed1991 avatar mujtabaahmed1991 commented on May 3, 2024

I am also interested to work on this, @Ngo-The-Trung lets get in touch.

from mcrouter.

ELD avatar ELD commented on May 3, 2024

@Ngo-The-Trung Are you still working on this? If not, I'd be happy to take this track of work up. I'd really like to see mcrouter support the binary memcached protocol, too.

from mcrouter.

Ngo-The-Trung avatar Ngo-The-Trung commented on May 3, 2024

@ELD please take over

from mcrouter.

ELD avatar ELD commented on May 3, 2024

@Ngo-The-Trung Thank you, will do.

from mcrouter.

darjisanket avatar darjisanket commented on May 3, 2024

Any updates on support for binary protocol.

from mcrouter.

ndobromirov avatar ndobromirov commented on May 3, 2024

As they've mentioned mcrouter does support binary protocol for transferring data.
This will reduce the network overhead in a case where you have 2-step mcrouter setup like:
box 1: web app + mcrouter1.
Box 2: Memcache + mcrouter2

The communication channel would be like:

  • web app -> mcrouter1 (text, unix socket)
  • mcrouter1 -> mcrouter2 (binary, non-standard, network)
  • mcrouter2 -> memcached (text, unix socket)

I have not tested this but in reality it should reduce network overheads (at least) and allow for all the features to be used.
Will it be faster will likely depend on the workload.

from mcrouter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.