Hello,
Have been running some performance tests against latest stable Redis
which we used to store sessiondata using hash, key constructed with UUID
Problem:Response time increases over a period of time, in 11 hours it had increased from a few microseconds to 5 milliseconds. Load pattern was stable throughout the test period. Our expectation was, response time plateau period, but this unbounded increase has led me to write to this group. No memory swapping, checked /proc/**/smaps.
Our doubts, are:- Could be related to memory fragmentation? [since it involves a lot of deletes/create]
- The background task of actively expiring the keys, currently it is running 10 times a second and sampling 10 keys every time]
- Or anything that we havent covered?
Our Load scenario: [Single Redis instance configured with disk persistence]
- we constructed a java class using jedis library to do communciate with redis,
- Loadrunner was used to simulate multi threads, we simulated around 1000 TPS using 50 concurrent threads.
- Each iteration, create a new session key and there will be Read+Update+Read+Update+Update+Read+Update.
- This is repeated every 100-200 milliseconds by each of the 50 threads.
- The payload of each key is as follows,
- database,type,key,size_in_bytes,encoding,num_elements,len_largest_element
0,hash,"Samp.sess::3X4g1c6wqth7rHxepeq9c23G6.jvm",8459,hashtable,9,3164
- Read - using HGETALL and update using a transaction - MULTI [HMSET+EXPIREAT]. TTL -30 mins
Hardware:
Hardware is a high spec server with 96GB memory and dual Quad Xeon CPU. NUMA aware hardware.
Version:redis_version:2.6.14
os:Linux 2.6.32-279.22.1.el6.x86_64 x86_64
arch_bits:64
multiplexing_api:epoll
gcc_version:4.4.6
process_id:21023
run_id:f7d158548af84bd825ce724627581ba1fae057f1
tcp_port:6379
uptime_in_seconds:2580
uptime_in_days:0
hz:10
lru_clock:919368
Info stats: [File attached]
total_commands_processed:12881175
instantaneous_ops_per_sec:4352
rejected_connections:0
expired_keys:272071
evicted_keys:0
keyspace_hits:4293010
keyspace_misses:858602
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:4880
# Keyspace
db0:keys=586531,expires=586531
Others:
- ·
Response times for the
Read and Write transactions were in <1 milliseconds, however, after a
certain point in the test the response time starts on an increasing trend
and had reached 4 millisecond over a period of 11 hours.
- ·
Based on the OS
statistics, there were no paging happening on the redis process [based on proc
smaps] , it had more than sufficient memory. Max memory was set to 20GB, but
max used during the test was around 14GB.
- ·
Disk persistence was
enabled with frequency “save 300 10” running every 5 minutes, this forked a
child process which then writes the rdb file on the box, hence every 5 minutes
we see response times spike upto 12 milliseconds. Since redis is
singlethreaded, the client connections experience delay during the time taken
for the fork operation, max time for a fork was around 10milliseconds during
the test.
- ·
To isolate disk
persistence causing the increasing trend, we did a test with disk persistence
disabled. This had the increasing trend too.
Has anyone experienced this behaviour? Or is this a mis-configuration? Any directions will be very helpful.
Thanks
Raam