• Stars
    star
    105
  • Rank 317,783 (Top 7 %)
  • Language
    Go
  • License
    MIT License
  • Created over 7 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

imgo is a push server written by golang based on goim

Imgo

Imgo is a distributed and high performance push server written in golang based on goim. compared to goim,it added offline message support,add will support IM server later on.

Features

  • Light weight and high performance
  • Supports single push, multiple push and broadcasting
  • Supports one key to multiple subscribers (Configurable maximum subscribers count)
  • Supports authentication (Unauthenticated user can't subscribe)
  • Supports multiple protocols (WebSocket,TCP)
  • Supports offline message (you can push even if user is not online)
  • Scalable architecture (Unlimited dynamic comet,logic,router,job modules)
  • Asynchronous push notification based on Kafka

Architecture

Client connect to server:

arch

A client wants to subscribe a channel on comet through tcp or websocket,comet tells logic: "Here comes a guy,shall I keep a connection with him ?".

Logic take the token from comet and showed it to store: "Is this token valid? If it is,tell me the user id".

Logic got the user id,told router this user is online and keeps a connection with that comet,and told comet:"yes, you shall".

Then comet keeps connect to that client,and matains a heartbeat with him.

Logic knowed that comet and client was keep a connection, he ask store:"Is there any offline message of that user ?","yes,three of it",store answered and gave these to logic.

Logic packed the message into an envelope and thrown to kafka.

Job found a new envelope in kafka,fetch it and read the address:"comet 1,user 123456",then he told comet 1:"tell this to user 123456".

At last,comet told this message to user 123456.


Server push message to client:

arch

Caller(usually a bussiness system) tells logic:"I want to send hello to a person,his user id is 123456".

Logic got the user id,ask router:"Is user 123456 online ?","yes,he is keeping a connection with comet 1" router replied.

Logic packed the message into an envelope and thrown to kafka.

Job found a new envelope in kafka,fetch it and read the address:"comet 1,user 123456",then he told comet 1:"tell this to user 123456".

At last,Comet told this message to user 123456.

Protocol:

proto

Document

中文

Examples

Websocket: Websocket Client Demo

Java: Java

Benchmark

benchmark

Benchmark Server

CPU Memory OS Instance
Intel(R) Xeon(R) CPU E5-2630 v2 @ 2.60GHz DDR3 32GB Debian GNU/Linux 8 1

Benchmark Case

  • Online: 1,000,000
  • Duration: 15min
  • Push Speed: 40/s (broadcast room)
  • Push Message: {"test":1}
  • Received calc mode: 1s per times, total 30 times

Benchmark Resource

  • CPU: 2000%~2300%
  • Memory: 14GB
  • GC Pause: 504ms
  • Network: Incoming(450MBit/s), Outgoing(4.39GBit/s)

Benchmark Result

  • Received: 35,900,000/s

中文

English

LICENSE

imgo is is distributed under the terms of the MIT License.

More Repositories

1

req

Simple Go HTTP client with Black Magic
Go
3,904
star
2

kubernetes-guide

Kubernetes 实践指南
TypeScript
271
star
3

biu

a binary util of Go
Go
176
star
4

kubernetes-practice-guide

Kubernetes 实践指南(已过时,最新请看 https://imroc.cc/kubernetes/)
Shell
176
star
5

ontts

科大讯飞语音linux在线语音合成后台服务
Go
167
star
6

istio-guide

istio 实践指南
TypeScript
72
star
7

learning-kubernetes

Kubernetes 学习笔记
49
star
8

cert-manager-webhook-dnspod

cert-manager webhook resolver for DNSPod
Go
41
star
9

log

simple and useful logging tool of Go
Go
24
star
10

zk2etcd

zk2etcd 是一款同步 zookeeper 数据到 etcd 的工具
Go
24
star
11

learning-istio

记录 istio 相关知识与实践
14
star
12

scifi-page

personal web page for science fiction effect,very cool!
JavaScript
11
star
13

helm-cos

Helm plugin for manage helm repositories on Tencent COS
Go
8
star
14

tls

OpenSSL bindings for Go, compatible with crypto/tls,faster and more features.
Go
8
star
15

kubernetes-the-gradual-way

learn kubernetes from the primer to the mastery
Shell
5
star
16

airflow

Run Apache Airflow on kubernetes
Python
5
star
17

sh

sh is a light weight tool for using golang to execute shell script.
Go
5
star
18

imgo-java-sdk

java sdk for imgo
Java
4
star
19

tclient

灵活的腾讯云SDK
Go
4
star
20

helm-push

a helm plugin that allows you to push chart package to TencentHub
Go
4
star
21

kafka-monitor

docker image for KafkaOffsetMonitor
3
star
22

imroc.github.io

personal web page for roc chan
HTML
3
star
23

wechatbot

tuling wechat bot
Python
3
star
24

xhugo

A Extremly beautiful theme for Hugo
CSS
3
star
25

domain

a domain parser, like ruby's domainatrix
Go
3
star
26

httpcli

httcli is a http client library, making http request much easier
Go
3
star
27

md5x

golang md5 utility
Go
3
star
28

learning-tke

记录腾讯云容器服务相关知识与实践经验
3
star
29

webot

企业微信机器人SDK
Go
2
star
30

vim-go-ide

Fully vim configuration for best practice of Go development,and very easy to use.
Vim Script
2
star
31

k8s_baiduyun_uploader

下载kubernetes相关文件并上传到百度云
PHP
2
star
32

blog

my personal blog
2
star
33

conv

a golang util for convert data to the type you want
Go
2
star
34

system

common system call across different os with single API (open link in brower, etc)
Go
2
star
35

debugk8s

Go
2
star
36

learning-docker

分享 docker 相关知识与实践
Shell
2
star
37

imroc.cc

my personal website
TypeScript
2
star
38

kube-monitoring

monitoring stack for kubernetes
1
star
39

gitcli

git client abstraction for github,gitlab...
1
star
40

req-website

req's website
HTML
1
star
41

cyd

Shell
1
star
42

kubernetes-manifest

my kuberntes manifest
Makefile
1
star
43

knative-deploy

One-click deployment for knative
Makefile
1
star
44

ooui.js

Object Oriented web User Interface,making web more powerful
JavaScript
1
star
45

kube-apps

Deploy well known apps on kubernetes with best practices and less configuration
Smarty
1
star
46

scifi

my personal science fiction web page
1
star
47

maven-docker-example

Example repository of java maven project, build and run in container environment.
Java
1
star
48

assets

static resources
Shell
1
star
49

cos-go-sdk-v5

Tencent COS v5 SDK for Go
Go
1
star
50

beautifulhugo

Theme for the Hugo
HTML
1
star
51

learning-network

网络学习笔记
1
star
52

tke-guide

TKE 实践指南 (https://imroc.cc/tke)
TypeScript
1
star
53

docker-debian

useful debian docker images
1
star
54

types

handy type conversion tool based on reflection
Go
1
star
55

docker-golang

docker image for golnag
Go
1
star
56

istio-test

Go
1
star
57

helm-values

Shell
1
star
58

helm-charts

useful helm charts
Smarty
1
star
59

tech-note

My technical notes
TypeScript
1
star
60

kubernetes-troubleshooting-guide

Kubernetes 排错指南
Makefile
1
star
61

image-porter

A tool for syncing container images
Go
1
star
62

grpc-demo

Go
1
star