Soon I’m going to have 3 identical scripts on 3 different VPS’s and I want to have a fourth VPS which will control them all..
So for the sake of this question what I need to do is insert SQL rows and create files on the sub-servers, and the sub-servers also need to send statistical data back to the mother server. What is the most efficient way of doing this?
I was thinking of making scripts on the servers to do the jobs I need and using cURL to send requests to these scripts making use of URL parameters for the data which needs to be transferred, but perhaps there is a better way? Ideally I want it to be as fast as possible because they will most likely be sending requests to each other every second.
You could use XML-RPC, which exists in many manifestations:
https://www.php.net/manual/en/book.xmlrpc.php
If you want dead-simple, just use plain HTTP(S) requests, provided you’re careful about implementing it.
To perform a simple request, use cURL,
file_get_contents, orfopen. This website is packed full of usage examples.