You are getting 50k get requests/second because of network round-trip and processing overhead. Performing Redis get calls within a script will let you perform far more queries.
As an example:
josiah@linuxdev ~:$ redis-benchmark -n 1000000 -t get
====== GET ======
1000000 requests completed in 4.04 seconds
50 parallel clients
3 bytes payload
keep alive: 1
100.00% <= 0 milliseconds
247279.91 requests per second
josiah@linuxdev ~:$ cat test.lua
redis.call('get', 'foo')
redis.call('get', 'foo')
redis.call('get', 'foo')
redis.call('get', 'foo')
redis.call('get', 'foo')
# for the side-effect of loading the script
josiah@linuxdev ~:$ redis-cli --eval test.lua ,
(nil)
josiah@linuxdev ~:$ sha1sum test.lua
deccf55d13cf3eea10cf42169492977f5f5e4679 test.lua
josiah@linuxdev ~:$ redis-benchmark -n 1000000 evalsha deccf55d13cf3eea10cf42169492977f5f5e4679 0
====== evalsha deccf55d13cf3eea10cf42169492977f5f5e4679 0 ======
1000000 requests completed in 7.00 seconds
50 parallel clients
3 bytes payload
keep alive: 1
99.98% <= 1 milliseconds
99.99% <= 2 milliseconds
100.00% <= 3 milliseconds
100.00% <= 3 milliseconds
142795.95 requests per second
So, at the end I was able to perform roughly 140k lua calls/second, each of which did 5 get calls, for a total of ~700k total get requests performed/second. Compare that with the earlier ~247k get requests/second. Now in practice the performance difference will vary significantly, depending on what you are actually doing. But generally speaking, using Lua scripting will be faster than pipelined or non-pipelined requests.
And to answer your last question about executing the script as part of a redis-benchmark call, please see the different parts (the redis-cli --eval to load the script, the sha1sum to get the hash, and the redis-benchmark call to actually execute the script).
- Josiah