Q:

How can I get the amount of memory that remains for Redis

With REDIS command INFO i can get current memory usage:
For Example:
  'used_memory' => int 600832
  'used_memory_human' => string '586.75K' (length=7)
  'used_memory_rss' => int 1998848
  'used_memory_peak' => int 845056
  'used_memory_peak_human' => string '825.25K' (length=7)
  'used_memory_lua' => int 31744

And now i want to check how much memory left for Redis. 
Only way i see is to check  cat /proc/meminfo and compare it. 
Is there any other way to do it? 

A:

There is no built-in functionality in Redis to supply you with this information. 
The available memory is machine-wide.  Parsing /proc/meminfo is indeed a good way to get this info. 
See here for a python example: nagios plugins check_memory
We use a similar script on our dedicated redis machines (which run several redis-server instances a piece), that send alerts to our in-house exception handling portal when our memory limit is reached. 
Kind regards, TW

