当前位置:网站首页>How emqx 5.0 under the new architecture of mria+rlog realizes 100million mqtt connections
How emqx 5.0 under the new architecture of mria+rlog realizes 100million mqtt connections
2022-07-26 16:59:00 【InfoQ】
introduction : Single cluster 1 Billion MQTT Connection reached

4.x Time : Use Mnesia structure EMQX colony
Mnesia Introduce
- Embedded:and MySQL、PostgeresSQL When the database is different ,Mnesia and EMQX Is running in the same operating system process ( Be similar to SQLite). therefore EMQX You can read routes very fast 、 Conversation and other related information .
- Transactional:Mnesia Support transactions and have ACID Guarantee . And these guarantees are effective for all nodes of the entire cluster .EMQX Use where data consistency is important Mnesia Business , For example, update the routing table 、 Create rules engine rules, etc .
- Distributed:Mnesia The table will be copied to all EMQX node . This can improve EMQX Distributed fault tolerance , As long as a node survives, the data is safe .
- NoSQL:Traditional relational databases use SQL Interact with the database . and Mnesia Use it directly Erlang Read and write expressions and built-in data types , This makes the integration with business logic very smooth , And eliminate the overhead of data encoding and decoding .

Mnesia The problem of
- Insufficient horizontal expansion capacity .stay 4.x We do not recommend too many nodes in the cluster , Because the overhead of transaction replication in the mesh topology will be larger and larger ; Our general recommendation is to keep the number of nodes at 3~7 individual , And try to provide single node performance .
- An increase in the number of nodes will increase the possibility of cluster brain fissure .The more nodes 、 The number of links between nodes will also increase dramatically , Higher requirements for network stability between nodes . When there is a brain fissure , Node self-healing will lead to node restart and risk of data loss .
5.x Time : Use Mria Building large-scale clusters

Core and Replicant Node behavior
- Horizontal scalability ( As mentioned earlier , We have tested there 23 Of nodes EMQX colony )
- Easier automatic cluster expansion , There is no risk of data loss
EMQX 5.0 Cluster deployment practice
Cluster architecture selection
- In a small cluster(3 Nodes or less ), There is no need to use Core+Replicant Copying model , It can make Core Nodes undertake all traffic , Avoid increasing the difficulty of getting started and using .
- In a super large cluster(10 Nodes or more ), Make a proposal to MQTT Flow from Core Remove the node , This is more stable and has better horizontal scalability .
- In a medium-sized cluster, Depends on many factors , You need to test according to the actual scenario of users to know which is better .
Hardware configuration requirements
Monitoring and commissioning
- bootstrap:When Replicant After the node is started , Need from Core The process of node synchronizing the latest data table
- local_replay:When the node is finished bootstrap when , It must replay the write transactions generated in this process
- normal:When the cached transaction is fully executed , The node enters the normal operation state . Subsequent write transactions are applied to the current node in real time . Most of the time ,Replicant Nodes will remain in this state .
- emqx_mria_last_intercepted_trans: Since the node was started , The number of transactions received by sub regions . Please note that , This value may be different on different core nodes .
- emqx_mria_weight: A value for load balancing . Its change depends on the instantaneous load of the core node .
- emqx_mria_replicants: The number of replicators connected to the core node , Copy data for a given slice .
- emqx_mria_server_mql: Number of unprocessed transactions , Waiting to be sent to the replicator . The less, the better. . If this indicator has an increasing trend , Need more core nodes
- emqx_mria_lag: Replicator lag , Indicates the extent to which the replicator lags behind the upstream core node . The less, the better. .
- emqx_mria_bootstrap_time: The time spent in the process of starting the replica . This value will not change during the normal operation of the replica .
- emqx_mria_bootstrap_num_keys: The number of database records copied from the core node during boot . This value will not change during the normal operation of the replica .
- emqx_mria_message_queue_len: The message queue length of the replication process . It should always be 0 about .
- emqx_mria_replayq_len: The length of the internal replay queue of the replica . The less, the better. .
Conclusion
边栏推荐
- Response object - response character data
- TCP 和 UDP 可以使用相同端口吗?
- Use verdaccio to build your own NPM private library
- C#转整型的三种方式的区别以及效率对比
- The Ministry of Public Security issued a traffic safety warning for summer tourism passenger transport: hold the steering wheel and tighten the safety string
- 抓包与发流软件与网络诊断
- 接口比较器
- Wechat applet - network data request
- Using MySQL master-slave replication delay to save erroneously deleted data
- PXE efficient batch network installation
猜你喜欢

Tao and art of R & D Efficiency - Tao chapter

Can TCP and UDP use the same port?

Acl-ijcai-sigir top conference paper report meeting (AIS 2022) Note 3: dialogue and generation

How to ensure cache and database consistency

Difference between C event and delegation

【飞控开发基础教程1】疯壳·开源编队无人机-GPIO(LED 航情灯、信号灯控制)

带你一分钟了解对称加密和非对称加密

NUC 11 build esxi 7.0.3f install network card driver-v2 (upgraded version in July 2022)

【Flutter -- 进阶】打包

Current limiting comparison: how to choose sentinel vs hystrix?
随机推荐
There are six ways to help you deal with the simpledateformat class, which is not a thread safety problem
浅谈云原生边缘计算框架演进
怎么使用C语言嵌套链表实现学生成绩管理系统
Digital currency of quantitative transactions - merge transaction by transaction data through timestamp and direction (large order consolidation)
Win11自动删除文件设置方法
数字化转型怎么就那么的难?!
PyQt5快速开发与实战 3.2 布局管理入门 and 3.3 Qt Designer实战应用
Take you a minute to learn about symmetric encryption and asymmetric encryption
利用MySQL主从复制延迟拯救误删数据
The first case in Guangdong! A company in Guangzhou was punished by the police for failing to fulfill its obligation of data security protection
[e-mr] error recovery record of namenode
maximum likelihood estimation
视频媒介video
Video media video
匿名方法和lambda表达式使用的区别
C#事件和委托的区别
营销指南 | 几种常见的微博营销打法
How to balance open utilization and privacy security compliance of public data?
Pyqt5 rapid development and practice 3.4 signal and slot correlation
Win11如何关闭共享文件夹