The problem here is, that the redis client locks exclusively (you can verify that by measuring the time that it takes for a command for 1,2,3 etc.. threads, it will most probably be linear).
There are two solutions here:
- create a new client for every thread (be careful it will leave you with a lot of open files and for a long running process, it will kill your machine)
- implement a connection pool
- use this gem as your connection pool (I haven't tested it yet)