nikoloss / Rose Dewdrop
websocket消息发布集群 Rose&Dewdrop is a solution of websocket cluster
Stars: ✭ 124
Programming Languages
python
139335 projects - #7 most used programming language
Projects that are alternatives of or similar to Rose Dewdrop
Copper price forecast
copper price(time series) prediction using bpnn and lstm
Stars: ✭ 81 (-34.68%)
Mutual labels: stock
Stock Management System
An Introductory Stock Management System built on PHP, jQuery with AJAX in MVC pattern.
Stars: ✭ 95 (-23.39%)
Mutual labels: stock
Eflinventory V2
🏬 Point-of-sale and inventory tracking for small-scale retail stores. Easily manage inventory, purchases, sales, and damaged and/or expired products.
Stars: ✭ 106 (-14.52%)
Mutual labels: stock
Bugsnag Python
Official bugsnag error monitoring and error reporting for django, flask, tornado and other python apps.
Stars: ✭ 69 (-44.35%)
Mutual labels: tornado
Yahoofinanceapi
A handy Yahoo! Finance api wrapper, based on .NET Standard 2.0
Stars: ✭ 99 (-20.16%)
Mutual labels: stock
Work At Olist
Apply for a job at Olist's Development Team: https://bit.ly/olist-webdev
Stars: ✭ 93 (-25%)
Mutual labels: tornado
Qlib Server
Qlib-Server is the data server system for Qlib. It enable Qlib to run in online mode. Under online mode, the data will be deployed as a shared data service. The data and their cache will be shared by all the clients. The data retrieval performance is expected to be improved due to a higher rate of cache hits. It will consume less disk space, too.
Stars: ✭ 81 (-34.68%)
Mutual labels: stock
Pyadmin
管理后台脚手架,实现了RBAC, 和一个简单的SQLALCHEMY的Mapper工具,基于tornado框架
Stars: ✭ 114 (-8.06%)
Mutual labels: tornado
Kupi Terminal
Ccxt based, open source, customized, extendable trading platform that supports 130+ crypto exchanges.
Stars: ✭ 104 (-16.13%)
Mutual labels: stock
Examples Of Web Crawlers
一些非常有趣的python爬虫例子,对新手比较友好,主要爬取淘宝、天猫、微信、豆瓣、QQ等网站。(Some interesting examples of python crawlers that are friendly to beginners. )
Stars: ✭ 10,724 (+8548.39%)
Mutual labels: stock
Mns
Money never sleeps! IntelliJ IDEA平台插件. 支持查看股票实时行情. 支持美股, 港股, A股.
Stars: ✭ 113 (-8.87%)
Mutual labels: stock
What is Rose&Dewdrop?
Rose&Dewdrop 是一个基于tornado和zeromq的分布式websocket消息发布组件(所以您得先安装tornado,zmq模块!!!)
- 其中rose构建于zeromq主要承担消息发布中心角色(iHQ)
- dewdrop构建于tornado并集成一个小型HUB(PUB/SUB)发布中心
- rndsdk则承担给rose节点下达消息发布作业的角色
- 疑问请联系([email protected])
架构设计
- dewdrop中tornado集成一个zeromq的PUB/SUB的迷你hub(使用ipc协议),每个websocket会绑定一个sub订阅这个本机hub
- 本机hub同时订阅所有的rose-ihq节点,一旦rose-ihq发布消息,本地迷你hub做一次转发
- rndsdk是用来给rose iHQ下达消息作业的
为什么tornado节点不直接把websocket连接绑定zsocket sub到rose-ihq而是一个本地的HUB?
-
好处主要有两个
- 如果直接把tornado的websocket连接直接绑定到rose-ihq,那么rose-ihq的压力会很大,假设3个tornado节点每个节点10万连接,那么rose就要承担30万连接
- 另一个好处就是rose节点挂掉不会导致前端设备与tornado的连接中断,未来只需要恢复rose-ihq,前端可以无痛感知
-
坏处有一个
- 由于每个websocket连接进来需要绑定一个sub到迷你hub中去,这样就会产生两个zeromq连接,而一个zeromq连接会消耗两个fd,所以等于每个websocket客户端连接进来都会 消耗5个fd资源, 所以如果要达到100万并发连接你至少需要配置500万fd.
演示
实例在demo中,先把dewdrop的serv.py跟rose的ihq.py跑起来,然后运行sdk中wand的test2,是一个每几十毫秒生成一条广播股价的服务,然后在浏览器中打开index.html看效果。可以试着停止一下rose节点中断消息的发送,过一段时间再度开启,可以发现前端的webosket依旧可以继续接收消息,从而验证了这种架构的可靠性。
#安装依赖类库
$>pip install tornado zmq
#进入工程目录
$>cd rose-dewdrop
#在第一个terminal中运行dewdrop/serv.py开启ws服务
$>cd dewdrop
$>python serv.py
#在第二个terminal中运行ihq.py消息发布通道服务
$>cd rose
$>python ihq.py
#在第三个terminal中运行消息源
$>cd rndsdk
$>python wand.py
#最后把demo/index.html拖入浏览器(不支持ie)查看效果
注意
本代码在python2下写就,如果需要支持python3,请自行更改代码。
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].