Redis

Flush/clear cache and delete everything

  • FLUSHDB - Delete all the keys of the currently selected database and clear cache.

  • FLUSHALL - Remove all the keys of all the existing databases.

redis-cli FLUSHDB
redis-cli -n DB_NUMBER FLUSHDB
redis-cli -n DB_NUMBER FLUSHDB ASYNC
redis-cli FLUSHALL
redis-cli FLUSHALL ASYNC

Error: redis warning overcommit_memory is set to 0

Fix

  1. Add entry in /etc/sysctl.conf:

/etc/sysctl.conf
vm.overcommit_memory = 1
  1. Save and exit. Run sysctl -p to update and restart Redis.

Last updated