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

SCRIPT LOAD support #68

Open
matschaffer opened this issue Feb 20, 2013 · 9 comments
Open

SCRIPT LOAD support #68

matschaffer opened this issue Feb 20, 2013 · 9 comments

Comments

@matschaffer
Copy link
Contributor

It seems like it'd be a reasonable implementation to have any SCRIPT LOAD get sent to all servers. Possibly other commands that aren't key-specific as well.

Am I missing something or is this a reasonable idea that could be accepted as a PR?

@manjuraj
Copy link
Collaborator

Yes that seems like one possible way to do it.

Alternatively for commands that aren't key-specific we could execute them outside twemproxy. For example the "SCRIPT LOAD" command can be executed by an external proces on all the redises since it is not a command that you would run really frequently

@nitper
Copy link

nitper commented May 2, 2013

This would be extremely useful.

Right now we do client side sharding, and we have a lot of Lua scripts. On deploy we SCRIPT LOAD each one to each instance. A general way to run a command on each instance would be great, as we even periodically run scripts to clean up the keyspace.

Is anyone working on this? If not I can take a look.

@manjuraj
Copy link
Collaborator

manjuraj commented May 2, 2013

do you scripts change over time; if they don't they you can just load the script once on all redises and use EVALSHA

@nitper
Copy link

nitper commented May 2, 2013

They don't change every day, but fairly often, and new ones are added regularly. Right now we have 128 instances, so it would be nice to be able to load a script with one command through nutcracker rather than having to manage the server configuration in multiple places.

It would also be nice to be able to easily RUN a script on each instance. A simple example would be a script that runs KEYS some_object_prefix_{*} and then deletes all of them, or extends their TTL.

@mezzatto
Copy link
Contributor

mezzatto commented May 8, 2014

Are there any commands currently that behaves like this? I mean, you send the command to twemproxy and it forwards the command to all the servers in a pool.

@yihuang
Copy link

yihuang commented Dec 10, 2014

Because when redis restart, script sha cache is cleared anyway, so i think any decent redis client should be able to handle this already. So just send script command to any shard is ok.

edit: my mistake, it need to be sended to all servers eventually, currently command without keys is only be sended to one server.
Is there any plans to implement this? cause i've met this problem already, i'm willing to do it myself, but i'm not familiar with the code, any advice is appreciate.

@shmish111
Copy link

Did anyone ever get anywhere with this, we are considering using twemproxy and having to manage lua scripts separately is definitely a big negative

@umegaya
Copy link

umegaya commented Oct 21, 2015

@shmish111 hi, I have tackled this issue. but does not have enough confidence (only 1day code reading of twemproxy :<). can you test my fix?

@shmish111
Copy link

@umegaya that's awesome however at the moment I don't even have twemproxy installed, I was at the product evaluation stage when I saw this issue and asked as it is vital for our current setup. I will try to get it installed and test with the scripts that I intend to use however I don't know when I will have time. Can anyone else on this thread test it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants