RE: Significant response time delays between 8.0 and 8.1

"Steve Parry" <[email protected]>
Newsgroups gmane.comp.php.general
Message-ID <[email protected]>
Thanks Rich.
Answers below, prefixed by A:. Also added a table of differences between the PHP versions.
Cheers
...Steve


-----Original Message-----
From: richard gray <[email protected]> 
Sent: Tuesday, December 19, 2023 7:43 PM
To: Steve Parry <[email protected]>; [email protected]
Subject: Re: Significant response time delays between 8.0 and 8.1

On 18/12/2023 21:40, Steve Parry 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.
>
> 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.
>
> 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
>
>
Hi Steve

Seems strange to me.. a couple of questions...

Are the 2 PHP versions configured exactly the same? For example do both have opcache enabled?
A: Yes. Zend OPCache running on both.

When you ran your comparison tests you ran them using the same server I presume?
A: Yes.

Are you restarting the services i.e. Apache/PHP-FPM between each test?
A: No - The server is a shared hosting server - I have no control over restarting services. The issue is demonstrated by changing the PHP version in the CPanel using MultiPHP Manager - as many times as you like! 

Rich

I did a compare between the PHPInfo from PHP8.0 and PHP8.1 and found the following that might have an impact. 
As I really don't understand these parameters very well, could you suggest any which may have an impact that I could change? (Not sure how well a text only email will format this, but here we go!):

Parameter		PHP8.0		PHP8.1
Loaded Configuration 			File path error in 8.1?
allow_url_fopen  	Off		On
display_startup_errors 	Off		On
Expose_php 		Off		On
Log_errors 		On		Off
Mail.aff_x_header 	On		Off
Max_execution time 	600/30		 600/600
max_input_time 	120/60	 	120/120
memory_limit 		1024/128	1024/1024
output_buffering 	no value	 0
post_max_size 		512/2		512/512
variables_order 	GPCS		EGPCS
zend.assertions 		-1		1
PDO drivers				Additional PDO drivers seen
PDO_ODBC section 	No PDO_ODBC	PDO_ODBC section
Pgsql section in 8.1	No Pgsql	Pgsql section
session.cookie_httponly	 no value	 0
session.gc_divisor 	0		100
session.gc_probability 	0	 	1
url_rewriter.tags	a=href		area=href, frame=src, input=src, form=fakeentry	form=
Zend OPCache 		running	 	running
Environment section 			heaps more Variables defined 
PHP Variables section 			heaps more Variables defined

Many thanks!
Cheers
...Steve
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.