计算机工程与应用 ›› 2017, Vol. 53 ›› Issue (4): 123-127.DOI: 10.3778/j.issn.1002-8331.1506-0108

• 网络、通信与安全 • 上一篇    下一篇

Mosquitto大文件传输方式的研究与改进

曾  昂,李  宁,严  俊   

  1. 武汉理工大学 计算机科学与技术学院,武汉 430070
  • 出版日期:2017-02-15 发布日期:2017-05-11

Research and improvement of Mosquitto file transfer

ZENG Ang, LI Ning, YAN Jun   

  1. College of Computer Science and Technology, Wuhan University of Technology, Wuhan 430070, China
  • Online:2017-02-15 Published:2017-05-11

摘要: 针对Mosquitto当前传输方式在消息推送时占用内存随消息订阅者个数的增加而上升的问题,设计并实现了一种适用于大文件类型消息传输并降低服务器内存消耗的传输方式。实验结果显示,当存在100个消息订阅者、消息长度为25 MB左右时,与Mosquitto的传输方式相比,新的传输方式的内存消耗仅为前者的6%左右。这表明该传输方式有效控制了消息订阅者增加对内存消耗造成的影响。

关键词: Mosquitto, 消息推送, 传输方式, 消息队列遥测传输(MQTT)

Abstract: Aiming to the disadvantage that memory consumption rises with the increase of message subscribers in transmission mode of Mosquitto, it designs and realizes a new kind of transmission mode which is more suitable in large file transfer and decreases the memory consumption. The experimental results show that, when there are 100 message subscribers and the length of message is 25 MB, compared with the transmission mode of Mosquitto, the memory consumption of new mode is 6% of the former. It proves that the new mode can effectively control the impact caused by the increasing message subscribers to memory consumption.

Key words: Mosquitto, message pushing, transmission mode, Message Queuing Telemetry Transport(MQTT)