richardforth / apache2buddy

apache2buddy
Apache License 2.0
384 stars 72 forks source link

minor - ram amount #281

Closed paolobenve closed 5 years ago

paolobenve commented 5 years ago

I'm getting a line saying:

[ -- ] Your PHP Memory Limit (Per-Process) is 16G MB.

richardforth commented 5 years ago

Lol that's hilarious.

Why on earth is your php memory limit so high.

The default is in MB and it assumes you're not doing something this rediculous.

I will of course look into this bug in the script but you should know that a 16GB php limit is insanity.

richardforth commented 5 years ago

I am not near a computer but I will look into this bug

richardforth commented 5 years ago

http://php.net/manual/en/ini.core.php#ini.memory-limit

Maybe im assuming M and stripping M

richardforth commented 5 years ago

'# some PHP directives are measured in MB. we want to trim the "M" off

here for those that are

$result =~ s/^(.*)M$/$1/;' 
richardforth commented 5 years ago

OK so looks like that's what's going on.

Maybe should convert G to thousands of M.

Ideally though no one should ever be setting it so high as to need G

richardforth commented 5 years ago

128M becomes 128 MB

16G should become 16000 MB instead of 16G MB

Though logically youd expect 16 GB i think the problem is that the MB is a hard coded part of a formatted string. Adding too much extra code for something that should be quite a rare occurrence isn't worth it.

richardforth commented 5 years ago

Though thats not accurate either as its not 16000 it will be 16 x 1024 Not sure if sed does math but we would need to strip the G and multiply by 1024 to be accurate.

Sorry for the faux pas.

richardforth commented 5 years ago

Need more coffee and fags

I might be over engineering.

I also don't smoke.

richardforth commented 5 years ago

OK brain wave

Will need to run some proof of concepts when I get a chance to get back on the computer.

If we simply change the formatted string to remove the hard coded MB..

Then

Using sed

128M becomes 128 MB

16G becomes 16 GB

Example code

# some PHP directives are measured in MB. we want to trim the "M" off
# here for those that are
$result =~ s/^(.*)M$/$1 MB/;'
# some PHP directives are measured in GB. we want to trim the "G" off
# here for those that are
$result =~ s/^(.*)G$/$1 GB/;'
richardforth commented 5 years ago
sub detect_php_memory_limit {
    if ( ! $NOINFO) {
        our $apache_proc_php = get_php_setting('/usr/bin/php', 'memory_limit');
        show_info_box(); print "Your PHP Memory Limit (Per-Process) is ${CYAN}".$apache_proc_php." MB${ENDC}.\n";
        if ($apache_proc_php eq "-1") {
            show_advisory_box(); print "You should set a PHP Memory Limit (-1 is ${CYAN}UNLIMITED${ENDC}) which is not recommended.\n";
        }
    }
}
richardforth commented 5 years ago

On paper that works. I will run some tests and make appropriate changes.

richardforth commented 5 years ago

[ -- ] Your PHP Memory Limit (Per-Process) is 128M.

and

[ -- ] Your PHP Memory Limit (Per-Process) is 16G.

I opted for a simpler solution to this (I dont think it will have any knock on effects):

  1. Found the formatted string and removed the MB
  2. Removed the sed style text relacement that removes the M
richardforth commented 5 years ago

The issue has now been addressed, though just to remind you that that the php memory limit id NOT an absoluter and cumulative limite rbut a per process limit, so if you have 16GB of RAM and a 16GP php memory limit the maximum SAFE number of php processes is probably less than one - when you factor in operating system resources.

If youre running apache / mod_php and have Maxclients set to say 256, per-process means 16GB multiplied by 256:

# echo "256 * 16" | bc
4096

I make that exactly 4 Terabytes of RAM required.

That's why I laughed earlier. Not at you, but at how rediculous this is, and why - I mean this bug has been in apache2buddy for many years - and it IS a bug, kind of like a millenium bug where nobody assumed anyone would EVER have their php memory limit set in GB, Typically because as its a per process limit, you;d want as many processes to run as safely as possible.

Now you may argue that "it's been running fine for years", kinda like the argument I'm making about this bug thats been present for years, but that said, youd be putting yourself at a very high risk of a kernel panic, All it takes is some bad code to start swallowing vast amount of memory and not releasing it again.

That said i am very grateful for you reporting this and it has been fixed now and it literally reports what it sees in the config file, I hope it hasnt broken anything else, only time will tell.

paolobenve commented 5 years ago

The script reported the weirdly high value because I have memory_limit = -1 in cli/php.ini, while in apache/php.ini the value is memory_limit = 256M.

Shouldn't the script read the apache value? the cli one has a different usage

richardforth commented 5 years ago

Yes that is strange, can you please run the full script in verbose mode and paste it in here (feel free to anonymise your IP amd servername from the output) - You may also if you wish just cut it dwn to anything that shows where it decided to pull the php.ini from.

What annoys me about these issues is often it comes down to different implementations of apache, my preference is the redhat one where everying is in one file /etc/php.ini.

I guess its pulling the CLI version because its a CLI script and pulling values with a phpinfo style request and its so annoying having these different configs all over the place for different OS flavours.

Im happy to try and fix this for you if I can, though this issue (the formatting) is closed you can raise a fresh issue about it pulling from the wrong config file.

the verbose output should help me figure out what is going on in your particular case.

Best regards Richard

paolobenve commented 5 years ago
#################################################
apache2buddy.pl report for localhost (x.x.x.x)
#################################################
VERBOSE: UID of user is: 0
[ OK ] This script is being run as root.
[ OK ] The utility 'pmap' exists and is available for use: /usr/bin/pmap
[ OK ] The utility 'netstat' exists and is available for use: /bin/netstat
[ OK ] 'php' exists and is available for use: /usr/bin/php
[ OK ] The utility 'apachectl' exists and is available for use: /usr/sbin/apachectl
[ OK ] The 'python' binary exists and is available for use: /usr/bin/python
[ OK ] The port (port 8080) is a valid port.
[ -- ] We are attempting to discover the operating system type and version number ...
[ -- ] Distro: debian
[ -- ] Version: 9.6
[ -- ] Codename: 
[ OK ] This distro is supported by apache2buddy.pl.
VERBOSE: 9
VERBOSE: 6
[ OK ] This distro version is supported by apache2buddy.pl.
[ -- ] Hostname: localhost
[ -- ] Primary IP: 5.9.68.170
[ -- ] We are checking the service running on port 8080...
VERBOSE: 1 found listening on port 80
VERBOSE: Returning a PID of 4650
VERBOSE: PID is 4650
VERBOSE: Finding process running with a PID of 4650
VERBOSE: Found process /usr/sbin/apache2
[ -- ] The process listening on port 8080 is /usr/sbin/apache2
VERBOSE: First line of output from "/usr/sbin/apache2ctl -V": Server version: Apache/2.4.25 (Debian)

VERBOSE: Apache version: Apache/2.4.25 (Debian)
[ -- ] The process running on port 8080 is Apache/2.4.25 (Debian).
VERBOSE: The Apache root is: /etc/apache2
VERBOSE: The Apache config file is: apache2.conf
[ -- ] The full path to the Apache config file is: /etc/apache2/apache2.conf
VERBOSE:  mpm_prefork_module (shared)
VERBOSE: ITK DETECTTOR STARTED
VERBOSE: ITK DETECTTOR PASSED
VERBOSE:  mpm_prefork_module (shared)
VERBOSE:  mpm_prefork_module (shared)
VERBOSE: REGEX Filter started.
VERBOSE: REGEX Filter finished.
VERBOSE: prefork
VERBOSE: Return Value: prefork
[ -- ] Apache is using prefork model.
VERBOSE: Processing /etc/apache2/apache2.conf
VERBOSE: Adding /etc/apache2/mods-enabled/access_compat.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/actions.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/alias.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/auth_basic.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/auth_digest.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/authn_core.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/authn_file.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/authz_core.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/authz_groupfile.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/authz_host.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/authz_user.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/autoindex.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/cgi.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/dav_fs.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/dav.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/deflate.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/dir.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/dnssd.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/env.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/expires.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/fcgid.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/filter.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/geoip.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/headers.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/include.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/info.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/mime.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/mpm_prefork.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/negotiation.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/perl.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/php7.0.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/proxy_html.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/proxy_http.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/proxy.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/reqtimeout.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/rewrite.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/security2.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/setenvif.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/socache_shmcb.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/status.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/suexec.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/unique_id.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/xml2enc.load to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/actions.conf to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/alias.conf to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/autoindex.conf to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/dav_fs.conf to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/deflate.conf to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/dir.conf to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/dnssd.conf to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/fcgid.conf to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/geoip.conf to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/info.conf to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/mime.conf to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/mpm_prefork.conf to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/negotiation.conf to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/php7.0.conf to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/proxy.conf to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/proxy_html.conf to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/reqtimeout.conf to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/security2.conf to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/setenvif.conf to list of files for processing
VERBOSE: Adding /etc/apache2/mods-enabled/status.conf to list of files for processing
VERBOSE: Adding glob to /etc/apache2/conf.d/, is a directory
VERBOSE: Adding /etc/apache2/conf.d/adminer.conf to list of files for processing
VERBOSE: Adding /etc/apache2/conf.d/munin to list of files for processing
VERBOSE: Adding /etc/apache2/conf.d/phplist.conf to list of files for processing
VERBOSE: Adding /etc/apache2/conf.d/phpsysinfo.con to list of files for processing
VERBOSE: Adding /etc/apache2/conf.d/piwik.conf to list of files for processing
VERBOSE: Adding /etc/apache2/conf.d/server-info to list of files for processing
VERBOSE: Adding /etc/apache2/conf-enabled/charset.conf to list of files for processing
VERBOSE: Adding /etc/apache2/conf-enabled/gitweb.conf to list of files for processing
VERBOSE: Adding /etc/apache2/conf-enabled/javascript-common.conf to list of files for processing
VERBOSE: Adding /etc/apache2/conf-enabled/localized-error-pages.conf to list of files for processing
VERBOSE: Adding /etc/apache2/conf-enabled/munin.conf to list of files for processing
VERBOSE: Adding /etc/apache2/conf-enabled/other-vhosts-access-log.conf to list of files for processing
VERBOSE: Adding /etc/apache2/conf-enabled/phpmyadmin.conf to list of files for processing
VERBOSE: Adding /etc/apache2/conf-enabled/security.conf to list of files for processing
VERBOSE: Adding /etc/apache2/conf-enabled/serve-cgi-bin.conf to list of files for processing
VERBOSE: Adding /etc/apache2/sites-enabled/aaa-default.conf to list of files for processing
VERBOSE: Adding /etc/apache2/sites-enabled/xxxxxxx.conf to list of files for processing
VERBOSE: Processing /etc/apache2/mods-enabled/access_compat.load
VERBOSE: Processing /etc/apache2/mods-enabled/actions.load
VERBOSE: Processing /etc/apache2/mods-enabled/alias.load
VERBOSE: Processing /etc/apache2/mods-enabled/auth_basic.load
VERBOSE: Processing /etc/apache2/mods-enabled/auth_digest.load
VERBOSE: Processing /etc/apache2/mods-enabled/authn_core.load
VERBOSE: Processing /etc/apache2/mods-enabled/authn_file.load
VERBOSE: Processing /etc/apache2/mods-enabled/authz_core.load
VERBOSE: Processing /etc/apache2/mods-enabled/authz_groupfile.load
VERBOSE: Processing /etc/apache2/mods-enabled/authz_host.load
VERBOSE: Processing /etc/apache2/mods-enabled/authz_user.load
VERBOSE: Processing /etc/apache2/mods-enabled/autoindex.load
VERBOSE: Processing /etc/apache2/mods-enabled/cgi.load
VERBOSE: Processing /etc/apache2/mods-enabled/dav_fs.load
VERBOSE: Processing /etc/apache2/mods-enabled/dav.load
VERBOSE: Processing /etc/apache2/mods-enabled/deflate.load
VERBOSE: Processing /etc/apache2/mods-enabled/dir.load
VERBOSE: Processing /etc/apache2/mods-enabled/dnssd.load
VERBOSE: Processing /etc/apache2/mods-enabled/env.load
VERBOSE: Processing /etc/apache2/mods-enabled/expires.load
VERBOSE: Processing /etc/apache2/mods-enabled/fcgid.load
VERBOSE: Processing /etc/apache2/mods-enabled/filter.load
VERBOSE: Processing /etc/apache2/mods-enabled/geoip.load
VERBOSE: Processing /etc/apache2/mods-enabled/headers.load
VERBOSE: Processing /etc/apache2/mods-enabled/include.load
VERBOSE: Processing /etc/apache2/mods-enabled/info.load
VERBOSE: Processing /etc/apache2/mods-enabled/mime.load
VERBOSE: Processing /etc/apache2/mods-enabled/mpm_prefork.load
VERBOSE: Processing /etc/apache2/mods-enabled/negotiation.load
VERBOSE: Processing /etc/apache2/mods-enabled/perl.load
VERBOSE: Processing /etc/apache2/mods-enabled/php7.0.load
VERBOSE: Processing /etc/apache2/mods-enabled/proxy_html.load
VERBOSE: Processing /etc/apache2/mods-enabled/proxy_http.load
VERBOSE: Processing /etc/apache2/mods-enabled/proxy.load
VERBOSE: Processing /etc/apache2/mods-enabled/reqtimeout.load
VERBOSE: Processing /etc/apache2/mods-enabled/rewrite.load
VERBOSE: Processing /etc/apache2/mods-enabled/security2.load
VERBOSE: Processing /etc/apache2/mods-enabled/setenvif.load
VERBOSE: Processing /etc/apache2/mods-enabled/socache_shmcb.load
VERBOSE: Processing /etc/apache2/mods-enabled/status.load
VERBOSE: Processing /etc/apache2/mods-enabled/suexec.load
VERBOSE: Processing /etc/apache2/mods-enabled/unique_id.load
VERBOSE: Processing /etc/apache2/mods-enabled/xml2enc.load
VERBOSE: Processing /etc/apache2/mods-enabled/actions.conf
VERBOSE: Processing /etc/apache2/mods-enabled/alias.conf
VERBOSE: Processing /etc/apache2/mods-enabled/autoindex.conf
VERBOSE: Processing /etc/apache2/mods-enabled/dav_fs.conf
VERBOSE: Processing /etc/apache2/mods-enabled/deflate.conf
VERBOSE: Processing /etc/apache2/mods-enabled/dir.conf
VERBOSE: Processing /etc/apache2/mods-enabled/dnssd.conf
VERBOSE: Processing /etc/apache2/mods-enabled/fcgid.conf
VERBOSE: Processing /etc/apache2/mods-enabled/geoip.conf
VERBOSE: Processing /etc/apache2/mods-enabled/info.conf
VERBOSE: Processing /etc/apache2/mods-enabled/mime.conf
VERBOSE: Processing /etc/apache2/mods-enabled/mpm_prefork.conf
VERBOSE: Processing /etc/apache2/mods-enabled/negotiation.conf
VERBOSE: Processing /etc/apache2/mods-enabled/php7.0.conf
VERBOSE: Processing /etc/apache2/mods-enabled/proxy.conf
VERBOSE: Processing /etc/apache2/mods-enabled/proxy_html.conf
VERBOSE: Processing /etc/apache2/mods-enabled/reqtimeout.conf
VERBOSE: Processing /etc/apache2/mods-enabled/security2.conf
VERBOSE: Processing /etc/apache2/mods-enabled/setenvif.conf
VERBOSE: Processing /etc/apache2/mods-enabled/status.conf
VERBOSE: Processing /etc/apache2/ports.conf
VERBOSE: Processing /etc/apache2/banbots.conf
VERBOSE: Processing /etc/apache2/conf.d/adminer.conf
VERBOSE: Processing /etc/apache2/conf.d/munin
VERBOSE: Processing /etc/apache2/conf.d/phplist.conf
VERBOSE: Processing /etc/apache2/conf.d/phpsysinfo.con
VERBOSE: Processing /etc/apache2/conf.d/piwik.conf
VERBOSE: Processing /etc/apache2/conf.d/server-info
VERBOSE: Processing /etc/apache2/conf-enabled/charset.conf
VERBOSE: Processing /etc/apache2/conf-enabled/gitweb.conf
VERBOSE: Processing /etc/apache2/conf-enabled/javascript-common.conf
VERBOSE: Processing /etc/apache2/conf-enabled/localized-error-pages.conf
VERBOSE: Processing /etc/apache2/conf-enabled/munin.conf
VERBOSE: Processing /etc/apache2/conf-enabled/other-vhosts-access-log.conf
VERBOSE: Processing /etc/apache2/conf-enabled/phpmyadmin.conf
VERBOSE: Processing /etc/apache2/conf-enabled/security.conf
VERBOSE: Processing /etc/apache2/conf-enabled/serve-cgi-bin.conf
VERBOSE: Processing /etc/apache2/sites-enabled/aaa-default.conf
VERBOSE: Processing /etc/apache2/sites-enabled/xxxxxxx.conf
VERBOSE: Searching Apache configuration for the user directive
VERBOSE: ${APACHE_RUN_USER} 
VERBOSE: Using Ubuntu workaround for: user
VERBOSE: Processing /etc/apache2/envvars
VERBOSE: Searching Apache configuration for the pidfile directive
VERBOSE: ${APACHE_PID_FILE} 
VERBOSE: Using Ubuntu workaround for: pidfile
VERBOSE: Processing /etc/apache2/envvars
[ -- ] pidfile setting is /var/run/apache2$SUFFIX/apache2.pid.
VERBOSE: Stripping any quotes from string ...
VERBOSE: BEFORE (/var/run/apache2$SUFFIX/apache2.pid).
VERBOSE: AFTER (/var/run/apache2$SUFFIX/apache2.pid).
[ -- ] Actual pidfile is /var/run/apache2/apache2.pid.
[ -- ] Parent PID: 23233.
[ OK ] Memory usage of parent PID is less than 50MB: 10124 Kilobytes.
VERBOSE: PID passed to uptime function: 23233
VERBOSE: Raw uptime: 5-06:20:15
[ -- ] Apache has been running 5d 06h 20m 15s.
[ -- ] Your server has 63854 MB of PHYSICAL memory.
VERBOSE: Searching Apache configuration for the serverlimit directive
VERBOSE: 1000 
[ -- ] Your ServerLimit setting is 1000.
VERBOSE: Searching Apache configuration for the maxrequestworkers directive
VERBOSE: 900 
[ -- ] Your MaxRequestWorkers setting is 900.
[ OK ] Current Apache Process Count is 54, including the parent PID.
[ -- ] Number of vhosts detected: 40.
[ OK ] Current Apache vHost Count is less than maxrequestworkers.
VERBOSE: Searching Apache configuration for the MaxRequestsPerChild directive
VERBOSE: CONFIG NOT FOUND 
[ >> ] MaxRequestsPerChild directive not found.
[ -- ] This server is NOT running Plesk.
[ -- ] This server is NOT running cPanel.
[ -- ] This server is NOT running Virtualmin.
VERBOSE: PHP: Loaded Configuration File => /etc/php/7.0/cli/php.ini
VERBOSE: PHP: Attempting to find real apache php.ini file...
VERBOSE: PHP: Real apache php.ini file is /etc/php5/apache2/php.ini, using that...
[ -- ] Your PHP Memory Limit (Per-Process) is 16G.
VERBOSE: Begin detecting additional services...
VERBOSE: MySQL Detected
[ -- ] MySQL Detected => Using 484.34 MB of memory.
VERBOSE: Java NOT Detected
VERBOSE: Varnish Detected
[ -- ] Varnish Detected => Using 2.83 MB of memory.
VERBOSE: Redis NOT Detected
VERBOSE: Memcache Detected
[ -- ] Memcache Detected => Using 342.67 MB of memory.
VERBOSE: PHP-FPM NOT Detected
VERBOSE: Gluster NOT Detected

VERBOSE: End detecting additional services...
[ @@ ] Consider setting up a log rotation policy.
[ @@ ] Note: Log rotation should already be set up under normal circumstances, so very
[ @@ ] Large error logs can indicate a fundmental issue with the website / web application.
[ OK ] MaxClients has not been hit recently.
[ >> ] Apache only logs maxclients/maxrequestworkers hits once in a lifetime, if no restart has happened this event may have been rotated away.
[ >> ] As a backup check, please compare number of running apache processes (minus 1 for parent) against maxclients/maxrequestworkers.
[ >> ] For more information see https://github.com/apache/httpd/blob/0b61edca6cdda2737aa1d84a4526c5f9d2e23a8c/server/mpm/prefork/prefork.c#L809
VERBOSE: Checking logs for PHP Fatal Errors, this can take some time...
[ !! ] PHP Fatal errors were found, see summaries below.
[ @@ ] Check the logs manually.
[ @@ ]  - /var/log/apache2/error.qumran.log.1: 299
[ @@ ]  - /var/log/apache2/error.log.1: 11
[ @@ ]  - /var/log/apache2/error.xxxx.log.1: 5
[ @@ ]  - /var/log/apache2/error.log: 2
[ @@ ]  - /var/log/apache2/error.xxxx.log: 4
[ @@ ]  - /var/log/apache2/error.xxxx.log: 107
[ OK ] No package updates found.
VERBOSE: Memory usage by PID 4775 is 55372K
VERBOSE: Memory usage by PID 4777 is 61916K
VERBOSE: Memory usage by PID 4785 is 56368K
VERBOSE: Memory usage by PID 5157 is 27364K
VERBOSE: Memory usage by PID 5177 is 54860K
VERBOSE: Memory usage by PID 5180 is 55800K
VERBOSE: Memory usage by PID 5183 is 56896K
VERBOSE: Memory usage by PID 5186 is 55532K
VERBOSE: Memory usage by PID 5187 is 56468K
VERBOSE: Memory usage by PID 6786 is 6620K
VERBOSE: Memory usage by PID 6787 is 10156K
VERBOSE: Memory usage by PID 6864 is 58432K
VERBOSE: Memory usage by PID 6924 is 64832K
VERBOSE: Memory usage by PID 7217 is 58428K
VERBOSE: Memory usage by PID 8051 is 45912K
VERBOSE: Memory usage by PID 9484 is 61804K
VERBOSE: Memory usage by PID 9535 is 59980K
VERBOSE: Memory usage by PID 9546 is 58040K
VERBOSE: Memory usage by PID 17096 is 56760K
VERBOSE: Memory usage by PID 17097 is 57564K
VERBOSE: Memory usage by PID 18573 is 30976K
VERBOSE: Memory usage by PID 18576 is 56244K
VERBOSE: Memory usage by PID 18578 is 54908K
VERBOSE: Memory usage by PID 18873 is 54724K
VERBOSE: Memory usage by PID 18874 is 58168K
VERBOSE: Memory usage by PID 18904 is 57468K
VERBOSE: Memory usage by PID 18905 is 58104K
VERBOSE: Memory usage by PID 18906 is 52100K
VERBOSE: Memory usage by PID 18943 is 62000K
VERBOSE: Memory usage by PID 18947 is 49008K
VERBOSE: Memory usage by PID 19059 is 56092K
VERBOSE: Memory usage by PID 19101 is 57412K
VERBOSE: Memory usage by PID 24043 is 59980K
VERBOSE: Memory usage by PID 24918 is 58376K
VERBOSE: Memory usage by PID 24921 is 59868K
VERBOSE: Memory usage by PID 24953 is 62488K
VERBOSE: Memory usage by PID 24954 is 62448K
VERBOSE: Memory usage by PID 24956 is 56460K
VERBOSE: Memory usage by PID 24958 is 57420K
VERBOSE: Memory usage by PID 26294 is 58692K
VERBOSE: Memory usage by PID 26414 is 55728K
VERBOSE: Memory usage by PID 26549 is 33788K
VERBOSE: Memory usage by PID 26552 is 29256K
VERBOSE: Memory usage by PID 26554 is 55412K
VERBOSE: Memory usage by PID 27732 is 39472K
VERBOSE: Memory usage by PID 28014 is 24780K
VERBOSE: Memory usage by PID 29441 is 56812K
VERBOSE: Memory usage by PID 31425 is 62648K
VERBOSE: Memory usage by PID 31426 is 41584K
VERBOSE: Memory usage by PID 31452 is 18172K
VERBOSE: Memory usage by PID 31453 is 44248K
VERBOSE: Memory usage by PID 31454 is 54640K
VERBOSE: Memory usage by PID 31455 is 46536K
VERBOSE: Memory usage by PID 4775 is 55372K
VERBOSE: Memory usage by PID 4777 is 61916K
VERBOSE: Memory usage by PID 4785 is 56368K
VERBOSE: Memory usage by PID 5157 is 27364K
VERBOSE: Memory usage by PID 5177 is 54860K
VERBOSE: Memory usage by PID 5180 is 55800K
VERBOSE: Memory usage by PID 5183 is 56896K
VERBOSE: Memory usage by PID 5186 is 55532K
VERBOSE: Memory usage by PID 5187 is 56468K
VERBOSE: Memory usage by PID 6786 is 6620K
VERBOSE: Memory usage by PID 6787 is 10156K
VERBOSE: Memory usage by PID 6864 is 58432K
VERBOSE: Memory usage by PID 6924 is 64832K
VERBOSE: Memory usage by PID 7217 is 58336K
VERBOSE: Memory usage by PID 8051 is 45912K
VERBOSE: Memory usage by PID 9484 is 61804K
VERBOSE: Memory usage by PID 9535 is 59980K
VERBOSE: Memory usage by PID 9546 is 58040K
VERBOSE: Memory usage by PID 17096 is 56760K
VERBOSE: Memory usage by PID 17097 is 57564K
VERBOSE: Memory usage by PID 18573 is 30976K
VERBOSE: Memory usage by PID 18576 is 56244K
VERBOSE: Memory usage by PID 18578 is 54908K
VERBOSE: Memory usage by PID 18873 is 54724K
VERBOSE: Memory usage by PID 18874 is 58168K
VERBOSE: Memory usage by PID 18904 is 57468K
VERBOSE: Memory usage by PID 18905 is 58104K
VERBOSE: Memory usage by PID 18906 is 52100K
VERBOSE: Memory usage by PID 18943 is 59984K
VERBOSE: Memory usage by PID 18947 is 49008K
VERBOSE: Memory usage by PID 19059 is 56092K
VERBOSE: Memory usage by PID 19101 is 57412K
VERBOSE: Memory usage by PID 24043 is 59980K
VERBOSE: Memory usage by PID 24918 is 58376K
VERBOSE: Memory usage by PID 24921 is 59868K
VERBOSE: Memory usage by PID 24953 is 62488K
VERBOSE: Memory usage by PID 24954 is 62448K
VERBOSE: Memory usage by PID 24956 is 56460K
VERBOSE: Memory usage by PID 24958 is 57420K
VERBOSE: Memory usage by PID 26294 is 58692K
VERBOSE: Memory usage by PID 26414 is 55728K
VERBOSE: Memory usage by PID 26549 is 33788K
VERBOSE: Memory usage by PID 26552 is 29256K
VERBOSE: Memory usage by PID 26554 is 55412K
VERBOSE: Memory usage by PID 27732 is 39584K
VERBOSE: Memory usage by PID 28014 is 24780K
VERBOSE: Memory usage by PID 29441 is 56812K
VERBOSE: Memory usage by PID 31425 is 64696K
VERBOSE: Memory usage by PID 31426 is 41584K
VERBOSE: Memory usage by PID 31452 is 18172K
VERBOSE: Memory usage by PID 31453 is 44248K
VERBOSE: Memory usage by PID 31454 is 54640K
VERBOSE: Memory usage by PID 31455 is 46536K
VERBOSE: Memory usage by PID 4775 is 55372K
VERBOSE: Memory usage by PID 4777 is 61916K
VERBOSE: Memory usage by PID 4785 is 56368K
VERBOSE: Memory usage by PID 5157 is 27364K
VERBOSE: Memory usage by PID 5177 is 54860K
VERBOSE: Memory usage by PID 5180 is 55800K
VERBOSE: Memory usage by PID 5183 is 56896K
VERBOSE: Memory usage by PID 5186 is 55532K
VERBOSE: Memory usage by PID 5187 is 56468K
VERBOSE: Memory usage by PID 6786 is 6620K
VERBOSE: Memory usage by PID 6787 is 10156K
VERBOSE: Memory usage by PID 6864 is 58432K
VERBOSE: Memory usage by PID 6924 is 64832K
VERBOSE: Memory usage by PID 7217 is 58288K
VERBOSE: Memory usage by PID 8051 is 45912K
VERBOSE: Memory usage by PID 9484 is 61804K
VERBOSE: Memory usage by PID 9535 is 59980K
VERBOSE: Memory usage by PID 9546 is 58040K
VERBOSE: Memory usage by PID 17096 is 56760K
VERBOSE: Memory usage by PID 17097 is 57564K
VERBOSE: Memory usage by PID 18573 is 30976K
VERBOSE: Memory usage by PID 18576 is 56244K
VERBOSE: Memory usage by PID 18578 is 54908K
VERBOSE: Memory usage by PID 18873 is 54724K
VERBOSE: Memory usage by PID 18874 is 58168K
VERBOSE: Memory usage by PID 18904 is 55364K
VERBOSE: Memory usage by PID 18905 is 58104K
VERBOSE: Memory usage by PID 18906 is 52100K
VERBOSE: Memory usage by PID 18943 is 60000K
VERBOSE: Memory usage by PID 18947 is 49008K
VERBOSE: Memory usage by PID 19059 is 56092K
VERBOSE: Memory usage by PID 19101 is 57412K
VERBOSE: Memory usage by PID 24043 is 59924K
VERBOSE: Memory usage by PID 24918 is 58376K
VERBOSE: Memory usage by PID 24921 is 57764K
VERBOSE: Memory usage by PID 24953 is 62488K
VERBOSE: Memory usage by PID 24954 is 62448K
VERBOSE: Memory usage by PID 24956 is 56460K
VERBOSE: Memory usage by PID 24958 is 57420K
VERBOSE: Memory usage by PID 26294 is 58692K
VERBOSE: Memory usage by PID 26414 is 55728K
VERBOSE: Memory usage by PID 26549 is 33788K
VERBOSE: Memory usage by PID 26552 is 29256K
VERBOSE: Memory usage by PID 26554 is 55412K
VERBOSE: Memory usage by PID 27732 is 39680K
VERBOSE: Memory usage by PID 28014 is 24780K
VERBOSE: Memory usage by PID 29441 is 56812K
VERBOSE: Memory usage by PID 31425 is 64696K
VERBOSE: Memory usage by PID 31426 is 41584K
VERBOSE: Memory usage by PID 31452 is 18172K
VERBOSE: Memory usage by PID 31453 is 44248K
VERBOSE: Memory usage by PID 31454 is 54640K
VERBOSE: Memory usage by PID 31455 is 46536K
[ -- ] The smallest apache process is using 6.47 MB of memory
[ -- ] The average apache process is using 49.77 MB of memory
[ -- ] The largest apache process is using 63.32 MB of memory
VERBOSE: Available Mem: 63854
VERBOSE: Mysql Mem: 484.34
VERBOSE: Java Mem: 0
VERBOSE: Redis Mem: 0
VERBOSE: Memcache Mem: 342.67
VERBOSE: Varnish Mem: 2.83
VERBOSE: PHP-FPM Mem: 0
VERBOSE: Gluster Mem: 0
VERBOSE: Average Potential Use : 44793.00
VERBOSE: Mem Remaining: 63024.16
[ OK ] Going by the average Apache process, Apache can potentially use 44793.00 MB RAM:
        Without considering services: 70.15 % of total installed RAM
        Considering extra services: 71.08 % of remaining RAM
VERBOSE: Highest Potential Use : 56988.00
VERBOSE: Mem Remaining: 63024.16
[ OK ] Going by the largest Apache process, Apache can potentially use 56988.00 MB RAM:
        Without considering services: 89.25 % of total installed RAM
        Considering extra services: 90.43 % of remaining RAM

--------------------------------------------------------------------------------
### GENERAL FINDINGS & RECOMMENDATIONS ###
--------------------------------------------------------------------------------
Apache2buddy.pl report for server: localhost (5.9.68.170):

Settings considered for this report:
    Your server's physical RAM:                                   63854 MB
    Remaining Memory after other services considered:             63024 MB
    Apache's MaxRequestWorkers directive:                         900      <--------- Current Setting    
    Apache MPM Model:                                             prefork
    Largest Apache process (by memory):                           63 MB
[ OK ]  Your MaxRequestWorkers setting is within an acceptable range.
    Your recommended MaxRequestWorkers setting (based on available memory) is between 895 and 995. <------- Acceptable Range (10% of MAX)
    Max potential memory usage:                                   56988 MB
    Percentage of TOTAL RAM allocated to Apache:                  89.25  %
    Percentage of REMAINING RAM allocated to Apache:              90.43  %
--------------------------------------------------------------------------------
A log file entry has been made in: /var/log/apache2buddy.log for future reference.

Last 5 entries:

2018/12/01 08:25:05 Uptime: "3d 17h 48m 54s" Model: "Prefork" Memory: "63854 MB" MaxRequestWorkers: "900" Recommended: "825" Smallest: "6.37 MB" Avg: "39.46 MB" Largest: "76.41 MB" Highest Pct Remaining RAM: "109.07%" (107.70% TOTAL RAM)
2018/12/01 21:38:49 Uptime: "4d 06h 44m 21s" Model: "Prefork" Memory: "63854 MB" MaxRequestWorkers: "900" Recommended: "1001" Smallest: "6.67 MB" Avg: "38.06 MB" Largest: "62.98 MB" Highest Pct Remaining RAM: "89.90%" (88.77% TOTAL RAM)
2018/12/07 08:26:48 Uptime: "4d 23h 55m 40s" Model: "Prefork" Memory: "63854 MB" MaxRequestWorkers: "900" Recommended: "961" Smallest: "6.47 MB" Avg: "48.47 MB" Largest: "65.55 MB" Highest Pct Remaining RAM: "93.62%" (92.40% TOTAL RAM)
2018/12/07 12:37:55 Uptime: "5d 04h 02m 15s" Model: "Prefork" Memory: "63854 MB" MaxRequestWorkers: "900" Recommended: "983" Smallest: "6.47 MB" Avg: "54.47 MB" Largest: "64.08 MB" Highest Pct Remaining RAM: "91.52%" (90.32% TOTAL RAM)
2018/12/07 15:04:27 Uptime: "5d 06h 20m 15s" Model: "Prefork" Memory: "63854 MB" MaxRequestWorkers: "900" Recommended: "995" Smallest: "6.47 MB" Avg: "49.77 MB" Largest: "63.32 MB" Highest Pct Remaining RAM: "90.43%" (89.25% TOTAL RAM)

It seems that the guess of the correct apache's php.ini is failing: with phpinfo() I get

Loaded Configuration File | /etc/php/7.0/apache2/php.ini