Home Database Mysql Tutorial 为何要使用redis高版本的一封说服邮件

为何要使用redis高版本的一封说服邮件

Jun 07, 2016 pm 04:30 PM
redis use Version mail

最近公司内和OP同学针对在生产环境中redis的版本存在分歧,写了一封邮件来说服OP。文中提及了为何要使用redis2.4版本而不是2.2,以及解决他人的concern,先阐述过人的feature,再娓娓道来他人的concern并提出解决方法,最终OP还是compromise了,算是胜仗,这

最近公司内和OP同学针对在生产环境中redis的版本存在分歧,写了一封邮件来说服OP。文中提及了为何要使用redis2.4版本而不是2.2,以及解决他人的concern,先阐述过人的feature,再娓娓道来他人的concern并提出解决方法,最终OP还是compromise了,算是胜仗,这里记录下。

?

Dear Operation System同学,

?

先感谢OP同学提供给RD使用Redis的支持工作。对于Redis使用2.4.14还是2.2版本,详设评审时存在分歧。RD在多方面权衡下还是坚持使用2.4版本,其带来的好处一一道来。

?

1. 快速的导入

v2.4导入可以使用pipeline模式,在命令行即可以将raw command通过管道直接传递给redis-cli客户端批量导入。

?

具体命令如下:

?

echo `date` > importlog && ?cat cmd.raw | redis-cli -h 10.81.31.95 -p 16379 –pipe >> importlog && echo `date` >> importlog

?

耗时:3600w数据,4min导入。吞吐量15w/s。

?

?

v2.2导入使用plain command逐个将命令传递给redis,那么其每次发起远程调用的消耗非常大。

?

具体命令如下:

?

echo `date` > importlog2 && cat cmd.plain | redis-cli -h 10.81.31.95 -p 16379 >> importlog2 && echo `date` >> importlog2

?

耗时:3600w数据,510min导入。吞吐量1k/s。

?

?

结论:pipeline特性可以快速导入大数据,以最短最经济的方式完成任务,同时简化上线步骤,日后维护、数据迁移等工作也可以变得容易。

?

?

?

2. 其他原因

RDB文件持久化提速。

改用jemalloc的内存分配模式 是的内存碎片少,从而更节省内存。

详见链接

?

?

?

其他concern

?

Q:OP担心XX项目会带来YY数据的膨胀?

?

A:该项目目前正在kickoff阶段,倘若未来YY在业务数据量上骤增,可以启用迁移方案将redis集群迁移到内存更大的机器(会提前做好预算),迁移工作由于使用了2.4版本的pipeline特性,加之rdb持久化,可以平滑的完成,不存在复杂的迁移过程。

?

?

?

Q:为什么不用memcache?

?

A:

?

- 这个应用场景是需要满足100%命中率,因此将所有数据放入内存,实际上是将redis当做了一个K-V的DB来用,而不单纯看做一个cache。

?

- 启用持久化特性,当down机恢复,会迅速加载dump并预热。

?

- 项目组计划是将APP+DB的架构改成成为APP+CACHE+DB,因此需要将DB上的修改操作sync到NoSQL中,供业务模块快速获取数据,解决北斗“慢”的问题。

?

- Redis可以作为集中式的队列,或者一些业务不重要的数据存储介质,对于做分布式调用非常有帮助。系统一切可以用生产者消费模型替换的场景,均可以改造为使用redis,从而去除单点问题。分布式锁,pub/sub等功能更是日后可以利用的极佳功能。

?

?

另外,由于2.4是2.2版本的一个branch,是向下兼容的。

?

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Solution to 0x80242008 error when installing Windows 11 10.0.22000.100 Solution to 0x80242008 error when installing Windows 11 10.0.22000.100 May 08, 2024 pm 03:50 PM

1. Start the [Start] menu, enter [cmd], right-click [Command Prompt], and select Run as [Administrator]. 2. Enter the following commands in sequence (copy and paste carefully): SCconfigwuauservstart=auto, press Enter SCconfigbitsstart=auto, press Enter SCconfigcryptsvcstart=auto, press Enter SCconfigtrustedinstallerstart=auto, press Enter SCconfigwuauservtype=share, press Enter netstopwuauserv , press enter netstopcryptS

Golang API caching strategy and optimization Golang API caching strategy and optimization May 07, 2024 pm 02:12 PM

The caching strategy in GolangAPI can improve performance and reduce server load. Commonly used strategies are: LRU, LFU, FIFO and TTL. Optimization techniques include selecting appropriate cache storage, hierarchical caching, invalidation management, and monitoring and tuning. In the practical case, the LRU cache is used to optimize the API for obtaining user information from the database. The data can be quickly retrieved from the cache. Otherwise, the cache can be updated after obtaining it from the database.

Caching mechanism and application practice in PHP development Caching mechanism and application practice in PHP development May 09, 2024 pm 01:30 PM

In PHP development, the caching mechanism improves performance by temporarily storing frequently accessed data in memory or disk, thereby reducing the number of database accesses. Cache types mainly include memory, file and database cache. Caching can be implemented in PHP using built-in functions or third-party libraries, such as cache_get() and Memcache. Common practical applications include caching database query results to optimize query performance and caching page output to speed up rendering. The caching mechanism effectively improves website response speed, enhances user experience and reduces server load.

Recommended Office version most suitable for Win7 (perfectly compatible with Win7 system) Recommended Office version most suitable for Win7 (perfectly compatible with Win7 system) May 30, 2024 pm 05:24 PM

Many users are considering upgrading to the Windows 10 operating system. As Microsoft announced that it will no longer provide security updates and technical support for Windows 7. However, a considerable number of users still choose to stick to the Win7 system and look for office software suitable for this system. To help users improve office efficiency, this article will introduce several Office versions that are most suitable for Win7 systems. 1.Office2010: the perfect combination of stability and compatibility 2.Office2013: interface optimization and practical function upgrades 3.Office2016: new features of cross-platform collaboration and cloud storage 4.OfficeOnline: lightweight, free, online office anytime and anywhere 5 .WPSOffice:

How to upgrade Win11 English 21996 to Simplified Chinese 22000_How to upgrade Win11 English 21996 to Simplified Chinese 22000 How to upgrade Win11 English 21996 to Simplified Chinese 22000_How to upgrade Win11 English 21996 to Simplified Chinese 22000 May 08, 2024 pm 05:10 PM

First you need to set the system language to Simplified Chinese display and restart. Of course, if you have changed the display language to Simplified Chinese before, you can just skip this step. Next, start operating the registry, regedit.exe, directly navigate to HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlNlsLanguage in the left navigation bar or the upper address bar, and then modify the InstallLanguage key value and Default key value to 0804 (if you want to change it to English en-us, you need First set the system display language to en-us, restart the system and then change everything to 0409) You must restart the system at this point.

How to use Redis cache in PHP array pagination? How to use Redis cache in PHP array pagination? May 01, 2024 am 10:48 AM

Using Redis cache can greatly optimize the performance of PHP array paging. This can be achieved through the following steps: Install the Redis client. Connect to the Redis server. Create cache data and store each page of data into a Redis hash with the key "page:{page_number}". Get data from cache and avoid expensive operations on large arrays.

Apple's iOS 18 mail app gets AI wings: enhanced search, smart writing/reply, classification and summarization, etc. Apple's iOS 18 mail app gets AI wings: enhanced search, smart writing/reply, classification and summarization, etc. Jun 11, 2024 pm 09:34 PM

According to news on June 7, technology media AppleInsider published a blog post yesterday, revealing that Apple is developing Project BlackPearl internally, which mainly enhances the email application in iOS18 and macOS15 systems, allowing AI to help users compose and reply to emails. The relevant content is summarized as follows: Enhanced Search Project BlackPearl first enhances email search results, which will display more information from address books, locations and locally stored documents. Smart Replies In addition, the new "Smart Replies" function in the email application will provide appropriate reply content based on the locally running large language model (LLM) Ajax and combined with the context of the email. compose mail

Apple Vision Pro receives major update, visionOS 1.3 RC version released Apple Vision Pro receives major update, visionOS 1.3 RC version released Jul 25, 2024 pm 04:25 PM

According to news on July 24, Apple recently pushed the highly anticipated visionOS1.3RC version update to VisionPro headset users. This update marks Apple’s continued innovation and progress in the field of virtual reality. Although the official did not clearly disclose the specific content of this update, users generally expect it to include performance optimization, functional improvements, and bug fixes. The internal version number of this update is 21O771, 141 days have passed since the last update. However, due to caching issues with node server configurations in Apple's various regions, some users may experience delays in upgrades and updates. Apple recommends users to back up their data before installing updates to ensure information security. 1.VisionPro users can use the "

See all articles