I am building an infrastructure on EC2 where I have nginx as a load balancer in front of apache+php servers. Each apache server has some virtual hosts.
I am thinking the best way to scale when a virtual host gets too many requests to handle.
I think I could limit the connections per each virtual host, say 100, then when the connections become more than 100, I create a new instance (using ruby and the fog gem) and configure another virtual host on that instance, add another backend in the nginx balancer with the IP of the new instance.
Is this the way to go, or what do you recommend?