Git Product home page Git Product logo

Comments (8)

manjuraj avatar manjuraj commented on August 23, 2024

@xqpmjh I am assuming that you are using the config file https://github.com/twitter/twemproxy/blob/master/conf/nutcracker.yml

in this file, the pool listening on "127.0.0.1:22121" is a redis pool and hence only parses redis requests and responses

you either want to delete the line "redis: true" or use "redis:false"

from twemproxy.

manjuraj avatar manjuraj commented on August 23, 2024

your problem may also be the following: http://stackoverflow.com/questions/4745345/how-do-i-stop-phpmemcachedelete-from-producing-a-client-error

from spec: https://github.com/memcached/memcached/blob/master/doc/protocol.txt, delete format is 'delete [noreply]'

but it seems like php delete sends 'delete timeout [noreply]"

from twemproxy.

xqpmjh avatar xqpmjh commented on August 23, 2024

Thank you so much manjuraj~

But neithor delete(key, 0) nor upgrade the twemproxy could make it works.

Here is what I got from the log when PHP's memcache sending the 'delete' command to twemproxy :

[Thu Dec 6 15:23:45 2012] nc_proxy.c:207 p 7 listening on '127.0.0.1:22121' in memcache pool 0 'leaf' with 9 servers
[Thu Dec 6 15:24:56 2012] nc_proxy.c:337 accepted c 8 on p 7 from '127.0.0.1:41348'
[Thu Dec 6 15:24:56 2012] nc_core.c:207 close c 8 '127.0.0.1:41348' on event 0001 eof 0 done 0 rb 72 sb 48: Invalid argument
[Thu Dec 6 15:25:09 2012] nc_proxy.c:337 accepted c 8 on p 7 from '127.0.0.1:41393'
[Thu Dec 6 15:25:09 2012] nc_core.c:207 close c 8 '127.0.0.1:41393' on event 0001 eof 0 done 0 rb 72 sb 48: Invalid argument

It seems that twemproxy doesn't accept the command? But doesn't it just pass the commands to the group backend?

from twemproxy.

yugene avatar yugene commented on August 23, 2024

Guys, for those of you, who have problems with deletion through PHP memcache extension, there is a patch for twemproxy in my fork: yugene@b965652

from twemproxy.

bmatheny avatar bmatheny commented on August 23, 2024

This isn't part of the memcache spec and the PHP manual even says "It's not recommended to use the timeout parameter. The behavior differs between memcached versions, but setting to 0 is safe. Other values for this deprecated feature may cause the memcache delete to fail."

Doesn't seem like this should be part of master.

from twemproxy.

yugene avatar yugene commented on August 23, 2024

Agree, this should not be in the master.

Php extension manual is a bit misleading. You may set the timeout parameter to 0 or not use it at all, but it will appear in request to memcache (at least, in latest stable).

from twemproxy.

xqpmjh avatar xqpmjh commented on August 23, 2024

In fact, finally I fixed it by removing the "time" parameter of delete() within the source code of memcache(php) extension then recompile.
command_len = spprintf(&command, 0, "delete %s %d", key, time);
command[command_len] = '\0';
->
command_len = spprintf(&command, 0, "delete %s", key);

from twemproxy.

onimsha avatar onimsha commented on August 23, 2024

@yugene , so if i don't use your patch, there's no way i can send delete command from PHP to twemproxy ?

from twemproxy.

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.