I'm determining around the architecture of the application where "Http KeepAlive" and "lengthy polling" is going to be employed for faster response. Can there be anything for PHP which solves the issue that Tornado does for c10k?
I believed of utilizing nginx + PHP-FPM. However, for 1000 active connections, will not there be 1000 PHP-FPM processes?
I Quickly think we'll have a similar problem that Apache has with lots of standing connections. Is not it?
EDIT: I realize that nginx is going to be enough if Among the finest HTTP KeepAlive. But let's say I additionally want lengthy polling like tornado supports? Can there be anything similar in PHP?
For active connections (as with, loading and managing a defined PHP script), yes, you will see as numerous PHP processes as active connections. But KeepAlive is all about passive connections, and Nginx is excellent at handling passive KeepAlive connections with really low resource usage - for 1000's of these.
The issue with Apache is it, within the usual configuration with mod_php and mpm_prefork, requires a process for every connection even when it is simply a passive KeepAlive. Which means that most Apache servers actually do must have a PHP process in memory even when the bond is passive, but this isn't the situation should you run PHP as FastCGI. Apache may also handle plenty of passive connections should you run PHP as FastCGI and select the mpm_worker developing a far more lightweight thread per connection, but it is still not just like Nginx.
I do not get exactly what do you mean. the c10k relates to web-server (apache, nginx etc) to not PHP.
If you are using nginx you should not be worried about it
My response to this is to have a look at node.js, You specify a 100K Active connections which Node.js should handle fine as lengthy as you've the right hardware.
Node doesn't spawn new processes whenever a connection is created, the socket is positioned inside a queuing system but it is not really a typical queuing system, where 1 connection is processed and so the next one.
Node.js is well known at handling several connection's there HTTP Client Library is dependant on Keep-Alive type of moving, in addition to being extremely fast and effective.