Topic: Any recent changes that could cause increased memory consumption?

Hi,

We have an old server running php 5.4 (I know!). After a recent update apache has suddenly been using a lot more memory and we can't figure out why. This coincides with a puppet run (these are regular) which amongst other things has upgraded/installed packages, and I'm wondering about the possibility/probabily of any of the recent backports contributing to this?

The relevant yum log is:

Feb 24 13:02:39 Updated: 1:datadog-agent-5.11.2-1.x86_64
Feb 24 13:02:59 Updated: php-common-5.4.45-13.el6.remi.x86_64
Feb 24 13:03:00 Updated: php-cli-5.4.45-13.el6.remi.x86_64
Feb 24 13:03:00 Updated: php-pdo-5.4.45-13.el6.remi.x86_64
Feb 24 13:03:00 Updated: php-mysql-5.4.45-13.el6.remi.x86_64
Feb 24 13:03:00 Updated: php-5.4.45-13.el6.remi.x86_64
Feb 24 13:03:00 Updated: php-process-5.4.45-13.el6.remi.x86_64
Feb 24 13:03:00 Updated: php-soap-5.4.45-13.el6.remi.x86_64
Feb 24 13:03:00 Updated: php-gd-5.4.45-13.el6.remi.x86_64
Feb 24 13:03:00 Updated: php-xml-5.4.45-13.el6.remi.x86_64
Feb 24 13:03:01 Updated: php-mbstring-5.4.45-13.el6.remi.x86_64
Feb 24 13:03:01 Updated: php-mcrypt-5.4.45-13.el6.remi.x86_64
Feb 24 13:03:07 Installed: scl-utils-20120927-27.el6_6.x86_64
Feb 24 13:03:07 Installed: environment-modules-3.2.10-3.el6.x86_64
Feb 24 13:03:23 Installed: php54-runtime-2.1-4.el6.remi.x86_64
Feb 24 13:03:23 Installed: php54-php-common-5.4.45-13.el6.remi.x86_64
Feb 24 13:03:23 Installed: libzip-last-1.1.3-1.el6.remi.x86_64
Feb 24 13:03:23 Installed: php54-php-pecl-zip-1.13.5-1.el6.remi.x86_64
Feb 24 13:04:56 Updated: rackspace-monitoring-agent-2.6.10-1.x86_64
Feb 24 13:05:17 Installed: kernel-devel-2.6.32-642.13.2.el6.x86_64
Feb 24 13:05:34 Installed: puppet-3.8.6-1.el6.noarch

After this, suddenly apache is using much more memory and we're having to reboot server every 2 days!

I've since removed pecl zip (as that server doesn't need it) and datadog (since we don't need it necessarily) just on the offchange it would help, but of course it doesn't.

Any ideas?

Re: Any recent changes that could cause increased memory consumption?

No immediate idea

I will look in the security patch included in 5.4.45-13 to see if I can see some memory leak there.

BTW, each process is usually restarted after MaxRequestsPerChild (4000 by default), so should not require a service restart.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Any recent changes that could cause increased memory consumption?

We're also wondering if maybe a config file could have been over-written, any likelihood of this?

Not easy for us to reproduce sadly, we can create vagrant boxes from our puppet manifests but they'll take the latest repo version. Is there anything we can do on the server that would be useful for you?

(Also, how much do you want to look into it, I don't want to be sounding like we expect you to do anything at all, and the above is kind of sounding like we are which isn't the intention, so thanks so much for all you give to php community and obviously if it's a hassle just tell us where to go big_smile !)

Re: Any recent changes that could cause increased memory consumption?

1st: need to ensure if the update to 5.4.45-13 is the cause, so downgrading to 5.4.45-12 (still online)


> Also, how much do you want to look into it

Sorry, but not possible.
Only free community help here, best effort.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Any recent changes that could cause increased memory consumption?

More information: I have deeply review the changes (again) in 5.4.45-13

* 1 tiny security patch for "exif" (fix rounding): CVE-2016-10158
* 3 small security patches for "phar": CVE-2016-10159 and CVE-2016-10160

The same are applied in all versions (5.4, 5.5 on my repo and official 5.6+)

I don't see any reason for a memory leak in those.


P.S. backporting security fix to EOL branches is really a huge work, the reason why I try to review carrefully each change, and also only fix (at least) "medium" fix, the low ones are skipped, see https://wiki.php.net/security for classification explanation.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi