select vs poll vs epoll

LinuxSocketsEpollPosix Select

Linux Problem Overview


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 Solutions


Solution 1 - Linux

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.

Solution 2 - Linux

The author of CURL wrote an amazing article on poll vs select vs event libraries.

Solution 3 - Linux

Linux: epoll FreeBSD: kqueue Windows: ??

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionraviView Question on Stackoverflow
Solution 1 - LinuxKalantirView Answer on Stackoverflow
Solution 2 - Linuxunixman83View Answer on Stackoverflow
Solution 3 - LinuxYann RaminView Answer on Stackoverflow