For the last two months, some days, my requests(get/post) to external links are working with a delay. However, this issue only occurs in my code running on a server that I use heavily.
I have three servers. (Centos 7, Centos7, Windows Server) Both of have the same features. (One is the server that I use heavily and the request I send to the external link returns slowly).
While it turns very fast on Windows and 2nd centos server, it takes 5 seconds for it to turn on the heavily used Centos server. Why does this occur? I checked the ram & disk usage of the server, nothing abnormal. I turned the server off and turned it back on, still didn't fix it. This situation did not exist three days ago, when I woke up one morning, it started to be slow. As in the previous ones, I will wake up one morning and it will be fixed again.
Vesta is installed on my server, I am using Apache. Which service do I need to specifically control? The slowness is not specific to this link alone, it also loads slowly when I make a curl request elsewhere.
All servers are running in a data center located in Germany.
function tcmbKurlari(){
$url= 'https://www.tcmb.gov.tr/kurlar/today.xml';
$context = stream_context_create(array('ssl'=>array(
'verify_peer' => false,
"verify_peer_name"=>false
)));
libxml_set_streams_context($context);
$currency = simplexml_load_file($url);
return $currency;
}
print_r(tcmbKurlari());