Apache processess use 3,7gb RAM each

Zhenyapan

Verified User
Joined
Feb 23, 2018
Messages
429
Location
UA
Apache processes use 3,7gb RAM each.
Fresh install nginx_apache
centos 7x64, php 5.3 mod_php
Help me find out why so high memory consumption.
20-07-2020 15-48-13.jpg
 

jamgames2

Verified User
Joined
Aug 16, 2019
Messages
75
try check your client who's using php that consumpt your ram.

I move from mod_php to php-fpm that it's can find out easy and can block some php_function or custom template easy more than mod_php
 

Zhenyapan

Verified User
Joined
Feb 23, 2018
Messages
429
Location
UA
this server need mod_php as it was before reinstall from Centos 6 to Centos 7.
Another identical server with identical configuration, installed in same time, but with PHP 5.6 works normal:
20-07-2020 21-09-00.jpg
apache/php rebuild did not solve problem.
 

sysdev

Verified User
Joined
Jul 16, 2007
Messages
204
You can't really compare these 2 memory usages. PHP 5.x allocates memory on request, while PHP 7.x allocates a large chunk of memory when it starts. This benefits PHP 7.x's performance because it doesn't need to allocate mem every time your program needs it. On the other hand, it increases mom consumption for 'small' scripts. The VIRT column with the 3,7G (if I'm correct) represents the max memory this process can address. (RAM, mapped disk memoryfiles, memory shared with other processes, etc). The SHR column shows how much memory is actually used.
 

Zhenyapan

Verified User
Joined
Feb 23, 2018
Messages
429
Location
UA
I know that, but this is still unnormal, another older server with Centos 6 and same mod_php PHP 5.3 looks normal:
21-07-2020 23-37-25.jpg
 

sysdev

Verified User
Joined
Jul 16, 2007
Messages
204
Try comparing pmap <PID> and see if something looks very different (high mem usage). The mem is used by modules and/or memory these modules use. Try reducing maxrequestsperchild to lower the effects of memory leaks. But to get an apache process at 3,7g you'll have to run pretty bad php code or push a lot of modules in there... Switch tot php-fpm to find out if the cause is modules or bad php coding. Also, compare php -i outputs to make sure you have the exact same setup.
 
Top