FAQ
Hello Sri,

I will read this post about memory optimisation and test the tool what
you told me.

Like Marc said, I need define the desired behaviour, after that I will
define the solution, could be limit of memory, expiration of the keys,
etc...

Thank you
Martin.



On Thu, Apr 18, 2013 at 3:14 PM, Sripathi Krishnan wrote:

Definitely possible to optimize your memory.

First of all, find out if you are keeping more keys than you should. Its
possible there is a bug in your code and you aren't deleting keys, or your
data structures keep on increasing. Use
https://github.com/sripathikrishnan/redis-rdb-tools to find out if this
is the problem. It is good to check what sort of data ends up in redis.

If you determine all the keys are legit, can you afford to expire keys? If
yes, look at the key expiration policies that Redis offers. This way, some
keys will be removed automatically.

Beyond that, there are ways to optimize Redis memory usage. Some of these
tricks are documented over here http://redis.io/topics/memory-optimization.
I have a few more notes over here -
https://github.com/sripathikrishnan/redis-rdb-tools/wiki/Redis-Memory-Optimization

If you can explain your data model, we will have more concrete suggestions.


--Sri

On 18 April 2013 22:58, Marc Gravell wrote:

Based on the last few lines, none of the keys are set to expire. If you
cling onto lots of data: then yes, it needs to go somewhere. What is your
*desired* behaviour here? What do you want it to do? There are various
options - look for maxmemory and maxmemory-policy in redis.conf - or
alternatively, if possible use expiration to limit the number of keys that
remain in the database at any time.

Marc
On 18 Apr 2013 17:41, "Martin Aceto" wrote:

Hello,

I'm new on Redis, I started working two month ago on a small project and
like any project now is a big project than we expected.

The project run on a small server with 1.7 GB of RAM on amazon, and
today we found the unicorn instances down, because Redis grew and took all
memory.

Maybe is normal and we will need add more memory, I don't know.

Could be posible optimize the server ?

Below the redis db info

# Server
redis_version:2.6.11
redis_git_sha1:00000000
redis_git_dirty:0
redis_mode:standalone
os:Linux 2.6.32-5-xen-amd64 x86_64
arch_bits:64
multiplexing_api:epoll
gcc_version:4.4.5
process_id:29131
run_id:baeea9a594bae9626a3747fff170348c667e40ae
tcp_port:6379
uptime_in_seconds:732
uptime_in_days:0
hz:10
lru_clock:315406

# Clients
connected_clients:5
client_longest_output_list:0
client_biggest_input_buf:0
blocked_clients:0

# Memory
used_memory:1586144496
used_memory_human:1.48G
used_memory_rss:1620267008
used_memory_peak:1586196488
used_memory_peak_human:1.48G
used_memory_lua:31744
mem_fragmentation_ratio:1.02
mem_allocator:jemalloc-3.2.0

# Persistence
loading:0
rdb_changes_since_last_save:0
rdb_bgsave_in_progress:0
rdb_last_save_time:1366302132
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:-1
rdb_current_bgsave_time_sec:-1
aof_enabled:0
aof_rewrite_in_progress:0
aof_rewrite_scheduled:0
aof_last_rewrite_time_sec:-1
aof_current_rewrite_time_sec:-1
aof_last_bgrewrite_status:ok

# Stats
total_connections_received:5
total_commands_processed:2535
instantaneous_ops_per_sec:0
rejected_connections:0
expired_keys:0
evicted_keys:0
keyspace_hits:2815
keyspace_misses:0
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:0

# Replication
role:master
connected_slaves:0

# CPU
used_cpu_sys:4.72
used_cpu_user:29.54
used_cpu_sys_children:0.00
used_cpu_user_children:0.00

# Keyspace
db0:keys=1893395,expires=0


Thanks
Martin


--
You received this message because you are subscribed to the Google
Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to redis-db+unsubscribe@googlegroups.com.
To post to this group, send email to redis-db@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups
"Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to redis-db+unsubscribe@googlegroups.com.
To post to this group, send email to redis-db@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups
"Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to redis-db+unsubscribe@googlegroups.com.
To post to this group, send email to redis-db@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+unsubscribe@googlegroups.com.
To post to this group, send email to redis-db@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 5 of 5 | next ›
Discussion Overview
groupredis-db @
categoriesredis
postedApr 18, '13 at 4:42p
activeApr 18, '13 at 7:01p
posts5
users3
websiteredis.io
irc#redis

People

Translate

site design / logo © 2021 Grokbase