How to handle 20k concurrent persistent connections

view full story

http://serverfault.com – I'm trying to design an architecture to handle massive TCP socket connections and I'm in doubt on the limits of this architecture. I'll have to handle ~20k concurrent TCP connections and these are long-polling connections, they'll remain connected for long periods of time and will be sending data every minute. Using threads is out of question, since 20k threads will starve the system resources. I'm planning to use gevent to handle such amount of concurrent connections or even use haproxy and 2 servers (w/ gevent) to handle 10k connections each for instance. Does that makes sense ? Does anyon (HowTos)