Some of the necessary configuration for Redis

Source: Internet
Author: User
Tags redis version signal handler

[email protected] redis-2.8.19]#/usr/local/redis/bin/redis-server >>/data/redis-start.txt #从定向到文件, Convenient for us to view, the content is as follows:

[email protected] redis-2.8.19]# cat/data/redis-start.txt

[6033] -Jan at: +:42.506# warning:no Configfilespecified, using the default Config. In order to specify a configfileuse/usr/local/redis/bin/redis-server/path/to/redis.conf[6033] -Jan at: +:42.508* Increased maximum number of open files to10032(It is originally set to1024x768). [6033] -Jan at: +:42.509# Warning: +Bit instance detected but no memory limit set. Setting3GB MaxMemory limit with'noeviction'policy now. _._                                                             _.-``__"'-._                                                   _.-``    `. `_."'-._ Redis2.8. +(00000000/0) +bit.-`` .-```. ```\/    _.,_"'-._                                    (    '      ,       .-`  | `,    ) Running in stand alone mode|`-._`-...-` __...-.``-._|'` _.-'| Port:6379| `-._   `._    /     _.-'    | pid:6033`-._    `-._  `-./  _.-'    _.-'|`-._`-._    `-.__.-'    _.-'_.-'| | `-._`-._        _.-'_.-'| http//Redis.io`-._    `-._`-.__.-'_.-'_.-'|`-._`-._    `-.__.-'    _.-'_.-'| | `-._`-._        _.-'_.-'|                                    `-._    `-._`-.__.-'_.-'_.-'`-._    `-.__.-'    _.-'                                                 `-._        _.-'`-.__.-'                                               [6033] -Jan at: +:42.511# Server started, Redis version2.8. +[6033] -Jan at: +:42.511# WARNING Overcommit_memory is set to0! Background save may fail under low memory condition. To fix this issue add'vm.overcommit_memory = 1'To/etc/sysctl.conf and ThenReboot or run the command'sysctl Vm.overcommit_memory=1'  forThis is take effect. [6033] -Jan at: +:42.511# warning:the TCP Backlog setting of511Cannot be enforced because/proc/sys/net/core/somaxconn are set to the lower value of -. [6033] -Jan at: +:42.511* DB loaded from disk:0.000seconds[6033] -Jan at: +:42.511* The server is now a ready-to-accept connections on port6379[6033| Signal Handler] (1421421706) Received SIGINT scheduling shutdown ... [6033] -Jan at: +:46.643# User requested shutdown ... [6033] -Jan at: +:46.643*Saving the final RDB snapshot before exiting. [6033] -Jan at: +:46.663*DB saved on disk[6033] -Jan at: +:46.663# Redis is now ready to exit, Bye bye ...

1. Add configuration file

2, Configuration MaxMemory

3. Add 'vm.overcommit_memory = 1' to/etc/sysctl.conf and then reboot or run the command 'sysctl VM . Overcommit_memory=1' for this to take effect.

Configuration:

    1. To prevent the system from crashing due to full memory, you need to set the maxmemory in/ETC/REDIS/*.CNF
    2. Prevent errors, you can adjust the memory allocation policy
      /etc/sysctl.conf This is a recommendation you can see in the Redis log:   add Vm.overcommit_memory=1 Save, and execute: sysctl vm.overcommit_memory=1 make it effective/proc/ Sys/vm/overcommit_memory, this is the overcommit_memory value, this can be updated by the above settings.   0, indicates that the kernel will check for sufficient available memory to be used by the process, and if sufficient memory is available, the memory request is allowed; otherwise, the memory request fails and the error is returned to the application process.   1, which means that the kernel allows all physical memory to be allocated regardless of the current memory state.   2, which indicates that the kernel allows allocating more memory than the sum of all physical memory and swap space  

Some of the necessary configuration for Redis

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.