Forum Moderators: phranque

Message Too Old, No Replies

Send request to multiple servers after php script

         

soladon

12:36 am on Sep 22, 2008 (gmt 0)

10+ Year Member



Hello,

I have a php script that decides which servers should receive certain information. My question is how to then pass the request to those servers?
I have seen load balancing tools for linux but I thought of asking since I am new to this. Also what if instead of php I had a shell script, would it make things easier and how?

Thanks alot

soladon

1:57 am on Sep 22, 2008 (gmt 0)

10+ Year Member



Just to note that one way is through PHP using curl_multi, but I thought this solution might not be the fastest one... The servers in this case are connected in a LAN.

soladon

3:20 am on Sep 22, 2008 (gmt 0)

10+ Year Member



Another solution is by using shell_exec("php test1.php & php test2.php") to run them async. Would this the best way? Anyone?

jdMorgan

12:59 pm on Sep 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



PHP may not be the best solution in this case -- It seems to me that most such applications are written in PERL, and send reverse-proxy requests to the back-end servers. LibWWW-PERL, LWP:Simple, and other such HTTP-aware PERL libraries are the tools generally used -- The script must not only send the requests to the back-end, they must also accept the "answer" back, and then send it to the original requester (client).

You might want to look into these concepts, and then post back with more-specific questions.

I should also say that the information in the first paragraph above is pretty much all I know about the subject... :(

Jim