Search code examples
phplinuxnetwork-programmingload-balancingopenstack

PHP and server-to-server communication in LAN


I am doing a project that has to incorporate load-balancing using OpenStack platform. It boils down to spreading browser requests, that execute calculation-heavy scripts, across several virtual machines running some distro of Linux.

Due to all installation attempts of OpenStack going horribly wrong, I ended up using TryStack.org, which is a free and working environment. The obvious problem here is, it offers very limited resources. For instance, I can have only 1 floating (external) IP, which can be assigned to only 1 single instance (virtual machine) and there are measures that make it impossible to change it via API.

Due to those limitations, I have to work with a very peculiar setup: I have a network with nodes A, B and C. A, B and C can communicate with each other, but only A has an external IP, ie. is accessible by browser.

(illustration)

Therefore, I have to:

  1. direct all browser requests to A,

  2. have A request (and wait for) execution of calculation-heavy scripts on B/C,

  3. make B/C send back results once they are finished

  4. and finally have A dress results in HTML and send response back to the browser.

Is there any mechanism in PHP that can do 2. and 3.? If not, what (Linux-compatible) language/technology can do that? (I have already written almost all of the code in PHP, but I suppose I can switch.)

Alternatively: is there some other free OpenStack service that would allow me to give every instance an IP (in which case the spreading problem could be solved via simple redirects)?


Solution

  • As arkascha advised in the comments, I used curl to simply send a page request from A to B/C, and then parsed the page using text manipulation.