*** NEED HELP TESTING PLEASE ***
Around the middle of June 2019 I have suddenly had random slow PHP Curl responses on the server, something that you wouldn't notice unless you closely monitored your server.
Response times randomly go from 0.3sec to 5sec on page loads at random.
Running CentOS Linux 7.6.1810 (Core)
Plesk Onyx v17.8.11 after Update from 55 to 56
Possible around the time the Kernal updated to: 3.10.0-957.21.3.el7.x86_64
I first noticed only my big curl based cron jobs timing out and spent days trying to figure out why.
Any PHP task that contained multiple CURL requests would fail randomly and I get the same result directly in the SHELL. It seems to be caused no matter what version of PHP I select in Plesk for a website.
I blamed the VM hosting company initially as I thought the network speed had dropped off causing the issue but I ran a temporary Linux recovery boot system and tested from that and it worked just fine on the same VM.
I also noticed that it would cause a web page.. like wordpress to be slow at random but typically fast - so it could go unnoticed!! So instead of loading in 3sec it would take like 15sec. With zero server load and all resources at around 10 to 20%.
There is a way to test this and I was wondering if someone with a similar configuration could run this test and confirm that its a universal problem or if its just my server.
Run a little PHP script which will take up to 60 seconds to report back and look for *** which means there is a slow response.
HTTP Code: 200 || Response Time: 0.339ms
HTTP Code: 200 || Response Time: 0.665ms
HTTP Code: 200 || Response Time: 0.257ms
HTTP Code: 200 || Response Time: 0.643ms
HTTP Code: 200 || Response Time: 0.256ms
HTTP Code: 200 || Response Time: 5.788ms***
HTTP Code: 200 || Response Time: 0.638ms
HTTP Code: 200 || Response Time: 0.293ms
HTTP Code: 200 || Response Time: 0.258ms
HTTP Code: 200 || Response Time: 0.294ms
HTTP Code: 200 || Response Time: 0.352ms
HTTP Code: 200 || Response Time: 0.768ms
HTTP Code: 200 || Response Time: 0.255ms
HTTP Code: 200 || Response Time: 0.36ms
HTTP Code: 200 || Response Time: 0.751ms
HTTP Code: 200 || Response Time: 0.342ms
HTTP Code: 200 || Response Time: 0.634ms
HTTP Code: 200 || Response Time: 0.737ms
HTTP Code: 200 || Response Time: 0.271ms
HTTP Code: 200 || Response Time: 0.681ms
HTTP Code: 200 || Response Time: 0.35ms
HTTP Code: 200 || Response Time: 0.718ms
HTTP Code: 200 || Response Time: 0.744ms
HTTP Code: 200 || Response Time: 0.761ms
HTTP Code: 200 || Response Time: 0.761ms
HTTP Code: 200 || Response Time: 0.35ms
HTTP Code: 200 || Response Time: 0.761ms
HTTP Code: 200 || Response Time: 0.253ms
HTTP Code: 200 || Response Time: 0.364ms
HTTP Code: 200 || Response Time: 0.769ms
HTTP Code: 200 || Response Time: 0.648ms
To do this... copy the PHP code below into a file - eg: testcurl.php
Open that file on your web browser about 3 to 5 times (don't forget to give it up to 60 seconds to load each time)
Take note if you get any *** > 3 second alerts and how many you get.
Please report back if you find anything.
You can change the website it talks to in the code but I just put one in at random that I know is stable.
Below are some graphs from my servers own monitoring system that shows the issue..
30 Day Graph:
and below the 3hr graph:
Around the middle of June 2019 I have suddenly had random slow PHP Curl responses on the server, something that you wouldn't notice unless you closely monitored your server.
Response times randomly go from 0.3sec to 5sec on page loads at random.
Running CentOS Linux 7.6.1810 (Core)
Plesk Onyx v17.8.11 after Update from 55 to 56
Possible around the time the Kernal updated to: 3.10.0-957.21.3.el7.x86_64
I first noticed only my big curl based cron jobs timing out and spent days trying to figure out why.
Any PHP task that contained multiple CURL requests would fail randomly and I get the same result directly in the SHELL. It seems to be caused no matter what version of PHP I select in Plesk for a website.
I blamed the VM hosting company initially as I thought the network speed had dropped off causing the issue but I ran a temporary Linux recovery boot system and tested from that and it worked just fine on the same VM.
I also noticed that it would cause a web page.. like wordpress to be slow at random but typically fast - so it could go unnoticed!! So instead of loading in 3sec it would take like 15sec. With zero server load and all resources at around 10 to 20%.
There is a way to test this and I was wondering if someone with a similar configuration could run this test and confirm that its a universal problem or if its just my server.
Run a little PHP script which will take up to 60 seconds to report back and look for *** which means there is a slow response.
HTTP Code: 200 || Response Time: 0.339ms
HTTP Code: 200 || Response Time: 0.665ms
HTTP Code: 200 || Response Time: 0.257ms
HTTP Code: 200 || Response Time: 0.643ms
HTTP Code: 200 || Response Time: 0.256ms
HTTP Code: 200 || Response Time: 5.788ms***
HTTP Code: 200 || Response Time: 0.638ms
HTTP Code: 200 || Response Time: 0.293ms
HTTP Code: 200 || Response Time: 0.258ms
HTTP Code: 200 || Response Time: 0.294ms
HTTP Code: 200 || Response Time: 0.352ms
HTTP Code: 200 || Response Time: 0.768ms
HTTP Code: 200 || Response Time: 0.255ms
HTTP Code: 200 || Response Time: 0.36ms
HTTP Code: 200 || Response Time: 0.751ms
HTTP Code: 200 || Response Time: 0.342ms
HTTP Code: 200 || Response Time: 0.634ms
HTTP Code: 200 || Response Time: 0.737ms
HTTP Code: 200 || Response Time: 0.271ms
HTTP Code: 200 || Response Time: 0.681ms
HTTP Code: 200 || Response Time: 0.35ms
HTTP Code: 200 || Response Time: 0.718ms
HTTP Code: 200 || Response Time: 0.744ms
HTTP Code: 200 || Response Time: 0.761ms
HTTP Code: 200 || Response Time: 0.761ms
HTTP Code: 200 || Response Time: 0.35ms
HTTP Code: 200 || Response Time: 0.761ms
HTTP Code: 200 || Response Time: 0.253ms
HTTP Code: 200 || Response Time: 0.364ms
HTTP Code: 200 || Response Time: 0.769ms
HTTP Code: 200 || Response Time: 0.648ms
To do this... copy the PHP code below into a file - eg: testcurl.php
Open that file on your web browser about 3 to 5 times (don't forget to give it up to 60 seconds to load each time)
Take note if you get any *** > 3 second alerts and how many you get.
Please report back if you find anything.
You can change the website it talks to in the code but I just put one in at random that I know is stable.
PHP:
<?php
for ($i = 0; $i <=30; $i++)
{
$curlcheck = get_url_contents('https://blog.serverdensity.com/80-linux-monitoring-tools-know/');
}
function get_url_contents($url){
$execute="";
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
$execute = curl_exec($ch);
$total_time = "";
$httpcode = "";
if(!curl_errno($ch))
{
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$total_time = curl_getinfo($ch, CURLINFO_TOTAL_TIME);
echo 'HTTP Code: '.$httpcode.' || Response Time: ' . round($total_time,3).'ms';
if ($total_time>3) {echo '***<br>';} else {echo '<br>';};
clearstatcache();
};
curl_close($ch);
return $curlcheck;
}
?>
Below are some graphs from my servers own monitoring system that shows the issue..
30 Day Graph:
and below the 3hr graph:
Last edited: