Logically, there are at least four areas to look into to trouble-shoot this performance issue:
First, the hardware:
What's the load on the disks? Hardware issue? Does server 2 use slow disks? Do the disks run on the same machine?
Second, the Apache HTTP Server:
Are there any error reports in the Apache error log?
To get a better comparison, you can run the same Apache version and same configuration on both web servers.
Apache HTTP Server has a number of Caching modules, including cache_disk_module, cache_module and file_cache_module -- are these enabled on one/both web servers?
Try closing the TCP connection, as described here
PHP file_get_contents very slow when using full url
Third, the PHP configuration.
Are there any error reports in the PHP error logs?
Finally, the PHP script.
Try speeding up the PHP script. To speed up things, you could consider replacing file_get_contents() with a socket using fsockopen(). The snippet below is from the PHP documentation and explain how to use fsockopen():
$fp = fsockopen("www.example.com", 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "GET / HTTP/1.1\r\n";
$out .= "Host: www.example.com\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
}