I have a script that makes calls to an XML api on a remote server. Currently my script sends 10 requests serially to the remote server. It fully processes each request before sending the next one. This is a huge bottleneck for my server at the moment since each API request can take up to a second each. Since most of the time is spent waiting for the remote server to respond, I'm wondering if/how I can send the requests in parallel so that all 10 requests use the same one second latency instead of ten one second latencies...
I thought about calling the script 10 times using a system command and running them in the background to effectively create 10 processes, but I'm not sure if that's the best way to do it. I figure this problem has probably been solved before.