Welcome! Log In Create A New Profile

Advanced

Difference between FASTCGI and PROXYing

July 13, 2011 03:20PM
Hi there,

I have simple question regarding: what is the difference between these two load-balanced setups from performance perspective:

SETUP 1 - FASTCGI mode:
Machine 1 - Load Balancer:
NGinx as balancer is installed, Upstreaming is used to connect to the PHP-FPM servers below, using fastcgi_pass directive;
Machine 2 and 3: AppServers:
PHP-FPM installed. No NGinx installation;
HOW IT WORKS: Client request first comes to the Load balancer, it is redirected to AppServer using Upstreaming. Response is returned from AppServer to the LoadBalancer and to the client.


SETUP 2 - PROXY:
Load Balancer:
NGinx is installed, Upstreaming is used to redirect to the Machines below, using proxy_pass directive;
AppServers:
NGinx is installed as web-server. It listens to the incoming calls from LoadBalancer via port 8000 and relays them to the PHP-FPM via port 9000 using fastcgi_pass directive.
PHP-FPM is installed as FCGI and listens to the local NGinx-web-server via port 9000. It accepts calls from it and returns the response to it.
HOW IT WORKS: Client request first comes to LoadBalancer Nginx, and gets relayed to the NGinx@AppServer via Upstreaming, through port 8000. NGinx-web-server@AppServer receives the call from LoadBalancer and passes it via FCGI to its local PHP-FPM. PHP processes the request, and responds to the local app-server, which in return responds to the LoadBalancer. LoadBalancer answers the client's request.



Thanks and sorry for long explanations...
Subject Author Posted

Difference between FASTCGI and PROXYing

Shehi July 13, 2011 03:20PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 188
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready