Redis Online problems and solutions

Source: Internet
Author: User

Redis Memory configuration Size requirements

When you configure Redis, the memory should not exceed 50% of the total machine memory, or the Rdb file will cause the total memory of the machine to be low, so that IO waits, so that redis access speed dips

MaxMemory 12GB

The total Redis memory is set to 50% of the total machine memory, and when the Redis process consumes more than 40% of the machine's memory, the data needs to be migrated

Master-Slave synchronization fails when Redis data is large

When the Redis data is large, the Rdb file has several G, the first master-slave synchronization will transfer the entire RDB file and load into memory, the large data will cause slave not synchronized, has timed out. At this point, the master and slave will synchronize again, the loop fails. Need to modify relevant parameters

Repl-ping-slave-period 10

Repl-timeout 600

Client-output-buffer-limit slave 768MB 512MB 600

When Redis memory is large, the entire redis is not writable after Bgsave fails

There are options in the configuration, Gbsave fails to write, the configuration should be set to No

Stop-writes-on-bgsave-error No

Slave-serve-stale-data Yes

The Bgsave process is started in Redis and is not killed

Set No-appendfsync-on-rewrite to Yes, then kill

Enter via REDIS-CLI, then config set no-appendfsync-on-rewrite Yes

If you have slave to synchronize, you must first close slave and then kill the process

Redis is best run in the network (trusted environment)

Bind 127.0.0.1

Redis Persistence Process Related content

RDB Backup

Master Redis Disables RDB backup, enables AOF, and aof rewrite time to set a long point (you can also disable aof yourself, automatically switch from when the main problem occurs)

If proxy is not responding in migration

When the network is not good, the migration slot may cause the proxy to be unresponsive, this time need to restart the unresponsive proxy, otherwise it may cause proxy to go to the previous slot to find key, can not find

Redis process consumes more than 70% of total memory

If there is a salve with master for the first full synchronization, it may cause the master machine to run out of memory, read data from swap, IO wait causes the master processing volume to plunge, the need to start a new machine, and then migrate master data to the new machine, until the end of the move, Then the machine is down to restart, according to Reid is the memory configuration requires reconfiguration boot, and then joined to the group, the other machine data migration past.

Redis process consuming memory does not decrease

Redis consumes less memory than the maximum amount of memory in the configuration, and if not del key, its memory will not be reduced, even if hdel or migration, the memory will remain unchanged

Codis the slot migration completes while the migration is in progress to ZK failed

Codis When a migration occurs: When a slot is migrated, the key has been migrated, but the update slot state to ZK fails, causing the data to be found in this slot when the proxy is accessed. The reason is that the proxy does not know that the slot has been migrated, when external access will also require the migration of key from the source Redis to the current Redis, if the source Redis gives proxy return error, proxy directly exits the request.

Write-down disks are not allowed when Redis is fully synchronized with master and slave

When Redis is in master-slave synchronization, the Rdb file is written locally, and if there is not enough memory at this time, Redis IO waits cause the processing speed to plummet. You can do this by disabling the write disk operation, the environment IO waits, configured as follows

Repl-diskless-sync Yes

Redis Online problems and solutions

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.