Skip navigation

Update: Do not use this config for php.  Instead use php-fpm with xcache or apc.

To configure Nginx to load balance multiple FastCgi servers use this type of configuration:

upstream servercom {
server 127.0.0.1:44440;
server 127.0.0.1:44441;
server 127.0.0.1:44442;
server 127.0.0.1:44443;
server 127.0.0.1:44444;
}

location ~ \.php$ {
fastcgi_pass servercom;
fastcgi_index stream.app;
fastcgi_param SCRIPT_FILENAME /var/www/htdocs$fastcgi_script_name;
include /etc/nginx/fastcgi.conf;
}

If you’re using spawn-fcgi from lighttpd consider replacing it with php-fpm.

About these ads

5 Comments

  1. why php-fpm? it is better ?

  2. Mariuz – it provides much better performance and needs less resources.

  3. Memory management maybe ?

  4. memcaced

  5. is APC better than Xcache?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: