PHP/FCGI balancing

Igor Sysoev is at rambler-co.ru
Wed Jun 18 14:32:04 MSD 2008


On Wed, Jun 18, 2008 at 09:51:02AM +0100, Phillip B Oldham wrote:

> Igor Clark wrote:
> >I'm considering whether to:
> >
> >- leave all web serving to 8GB box 1, and dedicate 8GB box 2 to PHP 
> >application serving, or
> >
> >- load-balance web traffic between both 8GB boxes, say 70% to existing 
> >box and 30% to new box, and run PHP app server on new 8GB box.
> >
> >As per Q1, I'd like to be able to specify some weighting on the 
> >fastcgi-->PHP traffic so that I could tune which box processes what a 
> >bit more finely, but from what I can see in the nginx documentation, 
> >this isn't possible.
> >
> >The latter way seems to spread the load, but the former way dedicates 
> >machines to doing one thing at a time. Given that the nginx box is 
> >currently running at loads of less than 0.1 and has over 2GB of RAM 
> >free, perhaps the extra nginx muscle isn't necessary.
> >
> >There is a bit of processing overhead on the PHP side, as the AMF 
> >codec processing has to be done in PHP (the PHP AMF C extension has a 
> >bug with AMF3 which breaks our app) - although we're using APC, which 
> >seems to speed things up nicely.
> >
> >What do you think would be most sensible?
> Would it not be better to use the two 8's for MySQL and PHP (same set-up 
> on both, with the mysql db replicating from one to the other), and have 
> the two 4's as nginx servers in a fail-over scenario? I'd've thought 
> that nginx wouldn't benefit as much from the ram as PHP & MySQL would, 
> and ensuring that if one of the "app" servers goes down its not the end 
> of the world as you can still serve content.

nginx itself does not require much memory as MySQL or PHP.
However, the memory may be used by OS VM cache.


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list