6 ms·
Take care that select() is not good for a webserver. From manpage: WARNING: select() can monitor only file descriptors numbers that are less than
by amadvance 3y ago
Take care that select() is not good for a webserver. From manpage:
WARNING: select() can monitor only file descriptors numbers that
are less than FD_SETSIZE (1024)—an unreasonably low limit for
many modern applications—and this limitation will not change.
All modern applications should instead use poll(2) or epoll(7),
which do not suffer this limitation.
- pjc50 3y agoLol. 22 years ago, I worked for Zeus Web Server, which was built entirely around one-process-per-core webserving off select(), and it was so much faster than Apache for serving static content that the developers had built a business out of it. At the time it could saturate a gigabit ethernet link off the largest HP-UX server we could find. Sure, you should use the modern interfaces, but 1024 connections per process can get you surprisingly far.
- robdelacruz 3y agoThanks for this. Saw the bug you logged on github too. Agree that poll() should be used instead to avoid the FD_SETSIZE limitation. Maybe in the future when littlekitten webserver grows to be a big cat...