It is possible to reconfigure your Redis cache from a Redis client without stopping or restarting the service by executing the CONFIG SET command:
CONFIG SET maxmemory 2mb
However be aware that this will not change the redis.conf file and that your change is gone with the next restart of Redis. To persist your configuration change, you can use the CONFIG REWRITE command:
This will update all fields in your redis.conf file that don’t match the current configuration.