开发者

select vs poll vs epoll [closed]

开发者 https://www.devze.com 2023-01-22 12:58 出处:网络
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 10 years ago.

I am designing a new server which needs to support thousands of UD开发者_Python百科P connections (somewhere around 100,000 sessions). Any input or suggestions on which one to use?


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:

  • Load balancing techniques
  • Multi-threaded networking
  • Database architecture
  • Perfect hash tables

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.


Linux: epoll FreeBSD: kqueue Windows: ??

There are wrapper libraries, such as libevent and libev, which can abstract this for you.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号