Hello, I have a problem when I test in master-slave mode. The scenario is one master and two slaves. The master uses RDB persistent mode and the slave uses AOF persistent mode. The amount of data is about 500mb, but I pass the top command. Monitor the CPU single-core usage, and found that the single-core usage of redis is 90%-100%, and the pure environment is used. After investigation, I suspect that it is occupied during synchronization, because the main thread of redis occupies the highest time. I I would like to ask if this CPU usage is normal? If not, what could be the cause? Or will there be any parameter configuration tuning?

os version: centos 7.5 redis version: 3.2.12 clusters: 1 master, 2 slave

Sincerely waiting for your reply! thanks

Comment From: oranagra

you mean the slave eats 100% cpu while loading the dump the master sent it? seems reasonable (there's a busy loop that parses the file and populates the dictionary).. specifically if the entire dump fits in the file system cache, so it won't be waiting on IO. however, for 500mb this shouldn't take very long. if it does take long, then i wonder why.. maybe you can use gdb or pstack to check what it's dong. e.g. gdb -batch -ex "bt" -p <pid>

Comment From: 2944229393

Yes, as you said, I found through the redis log that the slowest full synchronization occurs every 30 seconds, and the fastest occurs even less than 5 seconds. I thought it was the master's backlog buffer too much. Small cause, but after I modified the repl-backlog-size configuration, I found that the situation did not improve, and at the same time, another slave server would lose the link frequently. What is the situation? However, I began to wonder if my version was too low, so I upgraded the version to 5.0.10. I found that there was no appeal, and the CPU usage was about 40%. Is this an optimization difference between versions? ?

Looking forward to your reply! thanks

Comment From: oranagra

few things that i'm not clear about from your text. you say that redis eats 100% CPU, but also that it keeps disconnecting and doing a full sync? in which case, maybe there's something useful in the log files. did the upgrade to redis 5.0 solve the problem or not?

i honestly no longer recall the delta between redis 3.2 and 5.0. i would advise to upgrade to 6.2.

Comment From: 2944229393

After the upgrade, these problems no longer appear, and the logs become normal. I will upgrade to 6.2 for testing. Thank you for your patience in answering!