Redis-运维开发常见问题

在开发中常见的问题

  1. frok操作

  2. 进程外开销

  3. AOF追加阻塞

  4. 单机多实例部署

fork操作

  • 1.同步操作

  • 2.与内存量息息相关:内存越大,消耗时间越长(与机器有关)

  • 3.info:latest_fork_usec #上一次执行redis_fork的时间

改善fork

  • 1.优先使用无立即或高效支持fork操作的虚拟化技术支持

  • 2.控制redis实例最大可用的内存:maxmemory

  • 3.合理配置Linux内存分配策略:vm.overcommit_memory=1

  • 4.降低fork频率:例如放宽AOF重写自动触发机制,不必要的全量设置

子进程开销和优化

1.CPU

  • 开销:RDB和AOF文件生成,属于CPU密集型

  • 优化:不做CUP绑定,不和CPU密集型部署

  • 在配置单机多实例时候,一定要避免大量的AOF重写或RDB的bgsave,保证节省CPU

2.内存

  • 开销:fork内存开销,copy-on-write

  • 优化:echo nerer>/sys/kernel/mm/transparent_hugepage/enbale

3.硬盘

  • 开销:AOF和RDB文件写入,可以结合iostat,istop分析

  • 优化:

  • 1.不和高硬盘负载服务部署在一起:存储服务、消息队列服务
  • 2.no-appendfsync-on-rewrite=yes
  • 3.根据写入量决定磁盘类型:例如ssd
  • 4.单击多实例持久化文件目录可以考虑分盘

AOF追加阻塞

redis阻塞定位

  • redis日志

  • info Persistence

  • Linux:top查看I/O资源使用程度

Redis-运维开发常见问题》有9个想法

  1. I like the valuable info you provide in your articles. I’ll bookmark your weblog and check again here frequently. I am quite sure I will learn a lot of new stuff right here! Good luck for the next!

  2. Great – I should definitely pronounce, impressed with your website. I had no trouble navigating through all tabs as well as related information ended up being truly simple to do to access. I recently found what I hoped for before you know it at all. Quite unusual. Is likely to appreciate it for those who add forums or anything, site theme . a tones way for your customer to communicate. Nice task.

  3. Very nice post. I just stumbled upon your blog and wished to say that I have really enjoyed surfing around your blog posts. In any case I’ll be subscribing to your feed and I hope you write again very soon!

  4. Simply desire to say your article is as astonishing. The clarity in your post is just spectacular and i could assume you are an expert on this subject. Well with your permission allow me to grab your feed to keep updated with forthcoming post. Thanks a million and please keep up the rewarding work.

  5. You could certainly see your expertise within the work you write. The sector hopes for even more passionate writers like you who are not afraid to mention how they believe. All the time go after your heart.

  6. A person necessarily assist to make critically articles I would state. That is the very first time I frequented your website page and up to now? I amazed with the analysis you made to make this particular submit incredible. Wonderful process!|

发表评论

电子邮件地址不会被公开。 必填项已用*标注