high-perf scalable unix socket server methods?

Started by
1 comment, last by Kensai 22 years, 11 months ago
While I know BSD sockets, the bulk of my socket programming experience is with Windows. I know the socket server method of choice on NT/2000 would be IOCP, but what is the equivalently high-end scalable method in unix? Forking processes with IPC? Any pointers?
Advertisement
What is IOPC? I''m not familiar with that term...

My intuition tells me that the optimal scaling solution for a Unix system would be handling n connections per process over m processes, using a select() on non-blocking sockets to handle read/writes. The values of n and m of course are a complete mystery to me. I would suggest experimenting. But you could probably handle at least 64 or 128 connections per process... possibly even ALL of your connections depending just how much you need this to scale?

Forking a new process for each seperate socket is a terribly bad idea, as I''m sure you''ve already guessed.
Yeah... your solution was the one that seemed to make the most sense to me... but then I started to think about how to manage the connection pool -- since people can connect or disconnect at any time, you''d need to implement some method to coalesce processes, hand socket handles around, or do some other kind of optimization to keep the number of connections per thread at the optimum level.

IOCP stands for i/o completion ports and it''s a really nifty way to do socket communications in NT/2000. It uses overlapped i/o in combination with a thread-pool but unlike WSAWaitForMultipleEvents, IOCP has no limit on the number of operations it can wait on (WSAWaitForMultipleEvents caps at 64, much like select). It provides high performance with fairly little work, though the documentation on it is practically nil.

This topic is closed to new replies.

Advertisement