Is there any limit on the number of arguments that command del
can handle?
Everything has a limit. This question intrigued me so I wrote a small script to test it out:
var
argv = require('yargs')
.demand('connection')
.demand('arglimit')
.argv,
redis = require('redis'),
connection = require(argv.connection),
client = redis.createClient(connection),
delArgs = [];
for (let i = 0; i < argv.arglimit; i += 1) {
delArgs.push('i'+i);
}
client.del(delArgs,function(err,resp) {
console.log(err);
console.log(resp);
client.quit();
});
Long story short, here is what I found:
Protocol error: invalid multibulk length
error between 1,004,000 arguments and 1,005,000 arguments..FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
errors start cropping up.So, there is a limit, but it's gigantic.
That's pretty cool! Thanks @stockholmux
Most helpful comment
Everything has a limit. This question intrigued me so I wrote a small script to test it out:
Long story short, here is what I found:
Protocol error: invalid multibulk length
error between 1,004,000 arguments and 1,005,000 arguments..FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
errors start cropping up.So, there is a limit, but it's gigantic.