When you have a powerful machine with many CPU cores, you might run into an error like
ERR DB index is out of range (Redis::CommandError)
This is because Redis defaults to at most 16 databases (0 to 15) and running tests in parallel might exceed that (your tests might run on databases 1..n
or 2..(n+1)
).
You can increase that limit:
-
Get number of CPUs of your machine.
nproc --all
-
Open up Redis configuration file.
sudo vim /etc/redis/redis.conf
-
Find
databases
row and increase it, e.g. set to CPU count + 2:databases 18
-
Save and close config file, then restart Redis:
sudo service redis-server restart
-
Confirm your configuration has been updated. The following command should return "
OK
".redis-cli select `nproc --all`
Posted by Daniel Straßner to makandra dev (2019-03-21 12:18)