New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
PHP 8.2 memory consumption now becomes insane.
Hi all,
with the newest PHP release 8.2 I notice the RAM consumption went too high here you can see 4 PHP-fpm process eat 80% of my VPS memory:-
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
nginx 735 0.0 21.0 861116 166412 ? S 00:13 0:41 php-fpm: pool www
nginx 733 0.0 20.2 855976 160296 ? R 00:13 0:43 php-fpm: pool www
nginx 740 0.0 19.8 847684 156652 ? S 00:13 0:41 php-fpm: pool www
nginx 737 0.0 19.7 848652 156164 ? S 00:13 0:41 php-fpm: pool www
My server had ~1GB of RAM, running WordPress, and php-fpm now uses 80% of it, with only 4 fixed pools, before I tweak it, my server went down every couple hours, since my server can't handle more than 4 instance of PHP.
If I had a more popular website with thousands of visitors, e.g. hundreds of them connecting at the same time, how much of RAM would you think PHP will be required?
Comments
Something is definitely wrong in your config
No problem for me.
I have used php8.1 with latest version of wordpress (wp 6.1 as i remember) and got errors when uploaded an image on media.
So i still stuck with php7.4 for all of my wp for now.
It was PHP JIT setting I reduce
opcache.jit_buffer_size
to =20M from 128M but still not that much reduced.Check your nginx config for allocation sizes to the fpm pools. Something else is going on here and I can't tell what it is without more info.
Could be a memory leak and/or a plugin causing issues, who knows.
I guess that would be a place to start at least. Disable plugins one by one and see if it helps.
Disable opcache too.
For WordPress, some suggestions:
If there is a possibility and if necessary, both point 2 and 3 can be done on another hosting or server (a copy of the site)
Kindly install wordpress reduce memory plugin
You can check why a process consumes so much memory by running:
Thanks, at last a comment that makes sense.
https://pastebin.ubuntu.com/p/SDSR4qYvgK/plain/
I think JIT is bugged in PHP 8.2 as mine was also kept crashing, I had to switch back to 8.1.
There were some JIT fixes merged to 8.2.2, not sure if it'll fix the issue.
But I will wait for some more updates since the performance difference between 8.1 and 8.2 is negligible and I don't need its new functions.