选择vs投票vs epoll [英] select vs poll vs epoll
问题描述
我正在设计一个新服务器,该服务器需要支持数千个UDP连接(大约100,000个会话).关于使用哪个输入或建议?
I am designing a new server which needs to support thousands of UDP connections (somewhere around 100,000 sessions). Any input or suggestions on which one to use?
推荐答案
如果您使用的是Linux,答案是epoll;如果您使用的是FreeBSD或Mac OS X,答案是kqueue;如果您使用的是i/o,则答案是i/o在Windows上.
The answer is epoll if you're using Linux, kqueue if you're using FreeBSD or Mac OS X, and i/o completion ports if you're on Windows.
(几乎可以肯定)您需要研究的其他一些东西是:
Some additional things you'll (almost certainly) want to research are:
- 负载均衡技术
- 多线程网络
- 数据库体系结构
- 完美的哈希表
此外,重要是要注意的是,与TCP相比,UDP没有连接".从小规模开始并扩大规模也符合您的最大利益,因为调试基于网络的解决方案可能具有挑战性.
Additionally, it is important to note that UDP does not have "connections" as opposed to TCP. It would also be in your best interest to start small and scale larger since debugging network-based solutions can be challenging.
这篇关于选择vs投票vs epoll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!