Redis is an open source, advanced key-value store. It supports data structures like lists, sets, sorted sets, and hashes. Redis can persist data on disk using Redis Database files or append-only files. Redis supports master-slave replication where slaves can be promoted to masters in case of failures using Redis Sentinel. The main thing to note is that Redis is single-threaded, so long operations can block the server.
54. RDB - BAD
• Bad Performance in Large memory.
• Twice memory problem.
• Denying write problem when storing
RDB fails.
• If you just want Cache. Turn off RDB
55. RDB – Large Memory
• Performance is relevant to Memory
Size.
17.1 GB
34.2 GB
68.4 GB
117 GB
56. RDB – Twice Memory
• fork() and COW(copy on write) Issue
–In Write Heavy System:
60. Real Case Study
• Background
–Can’t write to Redis Server
–Sentinel doesn’t find Server’s failure.
61. Real Case Study
• Reason
–If redis fails to save RDB, Redis basically
denies write operations from client.
–“MISCONF Redis is configured to save RDB
snapshots, but is currently not able to
persist on disk. Commands that may modify
the data set are disabled. Please check Redis
logs for details about the error.”
62. Real Case Study
• Reason
if (server.stop_writes_on_bgsave_err &&
server.saveparamslen > 0
&& server.lastbgsave_status == REDIS_ERR &&
c->cmd->flags & REDIS_CMD_WRITE)
{
flagTransaction(c);
addReply(c, shared.bgsaveerr);
return REDIS_OK;
}
63. Real Case Study
• Solution #1
• Solution #2
config set stop-writes-on-bgsave-error no
Turn off RDB Setting
2.6.12 부터 conf 에서 stop-writes-on-bgsave-error
설정이 가능해짐.