1

Background

I have a PHP-FPM sitting behind an Apache server. As I need to use two different configurations for PHP-FPM, I can configure it to be connected either on:

  • 127.0.0.1:9000 and 127.0.0.2:9000, or;
  • 127.0.0.1:9000 and 127.0.0.1:9001

Question

I think the above scenario could be applied generally and not just on PHP-FPM setup. So, my question is, is there any difference between a two ips on one port vs one ip on two ports setup? When would you use one over the other?

Question Overflow
  • 2,103
  • 7
  • 30
  • 45
  • Why not just use a unix socket for php-fpm instead of a network socket? That's the recommended configuration now, anyways. – EEAA Apr 30 '14 at 04:13
  • @EEAA, thanks for the suggestion. The default configuration file still uses the TCP approach. Will look into that soon. – Question Overflow Apr 30 '14 at 04:25

1 Answers1

1

I usually go for multi-IPs. Clients can easily connect to a new IP number (DNS hostname for example). To connect to a new port, you need to pass the client an argument, e.g. :9001. This becomes tricky to manage over time and there are few (any?) good ways to map ports to names humans can easily remember.

dmourati
  • 25,540
  • 2
  • 42
  • 72