RE: Significant response time delays between 8.0 and 8.1
| From: | Steve Parry | Date: | Tue, 19 Dec 2023 06:37:10 +0000 |
| Subject: | RE: Significant response time delays between 8.0 and 8.1 | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-328333@lists.php.net to get a copy of this message | ||
Thank you Deepak.
Sorry – I’m not sure of the mechanics of replying. It looks like just by email to the list which
creates another # number. If I’m doing it wrong, please let me know😊
The hosting server OS is
Apache Version 2.4.58
MySQL Version 8.0.35
Architecture x86_64
Operating System linux
The Javascript function is:
++++++++++++++++++++++++++++++++++++++++++++
function TEST_Refresh() {
jQuery(document).ready(function($){
TEST_Recordset_for_display = [];
TEST_Recordset_local = [];
TEST_currentrecord = [];
$searchmode = 'localcopy';
var jsonObjTEST = new Object();
jsonObjTEST.srch_criteria = '*'; //Retrieve all records
jsonObjTEST.searchmode = $searchmode;
jsonObjTEST.ssn_current_user = $SSN_current_user;
jsonObjTEST.authentic = location.pathname;
jsonObjTEST.Authorised_user = 'YeS?';
$url = 'SSN_Get_TEST_Records.php';
$.ajax({
url: $url,
type: 'GET', //Use GET as large volume of data being returned
datatype: 'json',
timeout: 15000,
data: jsonObjTEST
})
.done(function (databack, textStatus, jqXHR){
if ($.isJsonString(databack)) {
TEST_Recordset_local = JSON .parse(databack);
for (var i = 0; i < TEST_Recordset_local.length; i++) {
tmpstr = TEST_Recordset_local[i].TEST_fullpreferredname_rev;
TEST_Recordset_for_display.push({'value':TEST_Recordset_local[i].TEST_fullpreferredname_rev,'label':tmpstr});
};
} else {
errorintro = 'Retrieving Preload of ajax failed:';
displayTxt = databack;
console.log(errorintro + '\n' + displayTxt);
resetForm('SSN_TEST_form');
return false;
}
$TEST_record = TEST_Recordset_local;
return true;
})//End of request.done success callback handler
.fail(function (jqXHR, textStatus, errorThrown){
errorintro = 'Retrieving Preload of TEST ajax failed:';
displayTxt = $.OnjqXHRError(jqXHR, textStatus, errorThrown)
console.log(errorintro + '\n' + $.OnjqXHRError(jqXHR, textStatus,
errorThrown));
return false;
});
}); //End of JQuery
} //end function
+++++++++++++++++++++++++++++++++++++++++++
The server script is
++++++++++++++++++++++++++++++++++++++++++++
<?php
$rows = array('TEST' => 9999);
echo json_encode($rows);
return json_encode($rows);
die();
?>
+++++++++++++++++++++++++++++++++++++
Thank you!
From: Deepak Goel <deicool@gmail.com>
Sent: Tuesday, December 19, 2023 4:11 PM
To: Steve Parry <steve.z.parry@gmail.com>
Cc: php-general@lists.php.net
Subject: Re: Significant response time delays between 8.0 and 8.1
On Tue, Dec 19, 2023 at 7:11 AM Steve Parry <steve.z.parry@gmail.com <mailto:steve.z.parry@gmail.com> > wrote:
Hi Everyone.
I’m a hobby programmer, so please be kind😊
I’m investigating a performance degradation that I have between PHP8.0 and PHP8.1. I see a couple
of similar issues being raised but no resolutions that I’ve found.
In my live WordPress system I have HTML/Java scripts that make multiple ajax calls to PHP scripts on
the remote hosted web server. On upgrading to 8.1 the number of ajax calls failing with timeout
increased dramatically by a factor of between 4 to 8 depending on the frequency of calls at any one
time.
Are your OS libraries uptodate?
Examination of a comparison showed scripts were taking up to 15 seconds under PHP8.1 compared to 1-2
seconds on PHP8.0.
To isolate the issue I created a simple (non-WordPress) web script that on the click of an icon uses
ajax to send a retrieve request to a server script. The server test script simply immediately
returns one piece of hardcoded dummy jSON data with no processing.
Can you please share the code?
Based on the Chrome debugger Network tab, the time of the network calls triggered from the test
script under PHP8.0 are a response of around 25mS. Under 8.1 the timings are average 92mS. A factor
of about 3.7 slower under 8.1. This has been consistent on two separate servers.
My conclusion at this point is that my test setup is reflecting the same (or worse) time delay
factor between PHP8.1 and PHP8.0 as I am having on the full site. As my test setup is pure
HTML/Javascript and PHP on the server I think this might be an issue with PHP8.1.
Any advice or assistance is keenly welcomed! Thank you in advance.
Happy to share my scripts and the URL to the test script.
Cheers
…Steve
Deepak
"The greatness of a nation can be judged by the way its animals are treated - Mahatma
Gandhi"
+91 73500 12833
deicool@gmail.com <mailto:deicool@gmail.com>
LinkedIn: www.linkedin.com/in/deicool <http://www.linkedin.com/in/deicool>
Upwork: https://www.upwork.com/freelancers/~0150257dd6dfd15b4b
"Plant a Tree, Go Green"
Make In India : http://www.makeinindia.com/home