Go实现的微博消息队列
有兴趣看实现消息队列原理的,请移步 https://github.com/YoungPioneers/mgq,感谢您的宝贵意见 IntroductionMemcached Go Queue,简称mgq,是一个用Go语言写的,基于memcached协议的消息队列。其父亲mcq是最早应用于weibo的基础消息中间件,有着高性能,解耦的优点,使得其广泛应用于微博 Featuresmgq是一个基于NOSQL数据库BerkeleyDB写的FIFO消息队列,目前支持的特性如下:
Benchmark针对消息的丢失率,做了一下单个set和get的测试,下面的是消息数为30w,50w,100w时候的结果 message total:30w mgq message set total:300000,cost total time:123518222205 ns,2428 per/s,fail set total:0 mgq message get total:300000,cost total time:51103619703 ns,5870 per/s,fail get total:0 message total:50w mgq message set total:500000,cost total time:210480212729 ns,2375 per/s,fail set total:0 mgq message get total:500000,cost total time:87694742059 ns,5701 per/s,fail get total:0 message total:100w mgq message set total:1000000,cost total time:422339921379 ns,2367 per/s,fail set total:0 mgq message get total:1000000,cost total time:173768683759 ns,5754 per/s,fail get total:0 同时简单做了一下压测,下面的结果依次是1,2,3,4个routine,单个set和get的相对平均耗时时间,Benchmark code Benchmark_MgqMultiSetAndGet-4 2000 546617 ns/op (1829 per/s) Benchmark_MgqMultiSetAndGet-4 2000 583259 ns/op (1714 per/s) Benchmark_MgqMultiSetAndGet-4 2000 723603 ns/op (1381 per/s) Benchmark_MgqMultiSetAndGet-4 2000 754741 ns/op (1324 per/s) (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |