There is no single best model for writing multi-tasking network servers. Different platforms have different solutions for high performance (I / O completion ports, epoll, kqueues). Be careful with maximum mobility: some functions are imitated on other platforms (i.e. select() available on Windows) and give very low performance because they simply map to some other proprietary model.
In addition, there are other models on your list. In particular, the classic UNIX "pre-fork" model.
In all cases, use any form of asynchronous I / O when available. If this is not the case, pay attention to non-blocking synchronous I / O. Build your HTTP library around asynchronous streaming, but keep the I / O bit. It is much more complicated than it seems. This usually involves recording machine states for your protocol interpreter.
This last bit is the most important because it will allow you to experiment with different views. It may even allow you to write a compact kernel for each platform of local high-performance tools and change this kernel from one platform to another.
source share