Table of Contents
回复内容:
Home Backend Development PHP Tutorial rabbitmq与gearman有什么不同之处?

rabbitmq与gearman有什么不同之处?

Jun 06, 2016 pm 04:45 PM
gearman rabbitmq

rabbitmq与gearman都是做消息队列的,那么两者之间有什么区别,或者说优点与缺点的比较各在哪里?

回复内容:

Gearman是分布式任务分发系统,重点是job
RabbitMQ是分布式消息队列,重在message/data

Gearman要实现Message的priority、order、filter、persistence..都比较麻烦(或者说不够直接),而这些都是典型的MQ系统要考虑的。 正如楼上回复的一样,Gearman 偏重任务分发(也有调度),基本工作模式,是由 Client (多个)向 Server 去注册一些函数,当然 Server 接受到任务后,分发到这些函数上。

RabbitMQ 则是很多消息模型的实现,比如简单的生产者消费者、发布订阅、广播,甚至可以模拟 RPC 等等,Gearman 的功能,简单的生产者消费者模型就可以实现,只是思路上稍微换一下,需要消费消息来实现,官方也有类似参考例子:RabbitMQ - RabbitMQ tutorial - Work queues

建议看下 RabbitMQ 官方这个例子教程 RabbitMQ - Getting started with RabbitMQ ,里面包含了几种模型的实例,很容易结合我们现实中场景。

至于优缺点,仁者见仁。

大概三年前吧,我给一家某行业内比较知名公司优化过 Gearman 到 RabbitMQ 的方案,高峰时候一小时消息量在 x 千万以上,优化前 Gearman Server 负载较重,包括 Client(Worker)也会经常挂掉,很多消息会丢失,后来迁移到 RabbitMQ 上面,Server 只有一台(备份一台基本从来就没用过),Client 采用 ACK 确认消息成功消费掉,后来就没有然后了。。。这里故事不在描述。

推荐使用 RabbitMQ,不仅仅是作为消息模型,还可以改善系统架构设计。
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 Article Tags

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)

How to use RabbitMQ to implement distributed message processing in PHP How to use RabbitMQ to implement distributed message processing in PHP Jul 18, 2023 am 11:00 AM

How to use RabbitMQ to implement distributed message processing in PHP

How to build a reliable messaging app with React and RabbitMQ How to build a reliable messaging app with React and RabbitMQ Sep 28, 2023 pm 08:24 PM

How to build a reliable messaging app with React and RabbitMQ

Using RabbitMQ in Go: A Complete Guide Using RabbitMQ in Go: A Complete Guide Jun 19, 2023 am 08:10 AM

Using RabbitMQ in Go: A Complete Guide

How SpringBoot integrates RabbitMQ to implement delay queue How SpringBoot integrates RabbitMQ to implement delay queue May 16, 2023 pm 08:31 PM

How SpringBoot integrates RabbitMQ to implement delay queue

Application practice of go-zero and RabbitMQ Application practice of go-zero and RabbitMQ Jun 23, 2023 pm 12:54 PM

Application practice of go-zero and RabbitMQ

Solution for real-time data synchronization between Golang and RabbitMQ Solution for real-time data synchronization between Golang and RabbitMQ Sep 27, 2023 pm 10:41 PM

Solution for real-time data synchronization between Golang and RabbitMQ

Golang RabbitMQ: Architectural design and implementation of a highly available message queue system Golang RabbitMQ: Architectural design and implementation of a highly available message queue system Sep 28, 2023 am 08:18 AM

Golang RabbitMQ: Architectural design and implementation of a highly available message queue system

Swoole and RabbitMQ integration practice: building a high-availability message queue system Swoole and RabbitMQ integration practice: building a high-availability message queue system Jun 14, 2023 pm 12:56 PM

Swoole and RabbitMQ integration practice: building a high-availability message queue system

See all articles