planetphp;10995256 wrote:I'd strongly urge you to consider the C/C++/Java route if you want millions of connections.
I don't think Java provides any advantage over PHP because
1) both Java and PHP run on a virtual machine of sorts
2) Java's compilation to byte code provides no substantive advantage over PHP's compile-on-demand for a daemon process which can run for hours/days/weeks each time it gets launched.
Some actual benchmarking would be most interesting, though.
Servers written in C or C++ are certain to be much faster I think. I wonder how involved/expensive such an undertaking might be? Either using RTMPD or writing a custom socket server in C? I'd wager C/C++ programmers are pricier than PHP/Java devs. If you are really serious, some assembler would really squeeze out serious performance.
In either case, writing daemons and multithreaded processes is trickier than simple scripts that handle page requests so your typical script jockey is probably inadequate. The programs typically run for a very long time and are much less linear. One has to contemplate concurrency and stochastic issues, watch out for memory leaks, etc.