antlabs / greatws Goto Github PK
View Code? Open in Web Editor NEW100w连接仅需500-700MB内存,针对海量连接特别优化的websocket库(kqueue, epoll),高性能,callback写法,在服务器cpu上有不俗表现 https://github.com/antlabs/greatws-example
License: Apache License 2.0
100w连接仅需500-700MB内存,针对海量连接特别优化的websocket库(kqueue, epoll),高性能,callback写法,在服务器cpu上有不俗表现 https://github.com/antlabs/greatws-example
License: Apache License 2.0
1. kqueue 对接完成,完成autobahn的测试
2. epoll 对接完成,完成autobahn的测试
3. go 程池
4. go程的拆分,分成一个全局的,和一个本地的
5. oneshot支持
6. 内存池复用率的优化
7. 有序性保证,对于语音类的长连接每个包接收顺序和发生顺序必须一样。
8. 定时器
9. 性能优化(当然这是最重要的)
扫了几眼,可能会有窜号问题,假设:
step 1: 应用模块A有close:
https://github.com/antlabs/bigws/blob/master/conn_unix.go#L45
或者event loop收到对端EOF后close了fd
step 2: 此时Conn被应用模块B协程池持有,并且正执行Write、马上要syscall但尚未syscall:
https://github.com/antlabs/bigws/blob/master/conn_unix.go#L61
step 3: 新的连接到来,被分配了这个fd
step 4: step 2中执行到了syscall write,数据被写入到了新的fd中
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.