When using Heroku's PHP buildpack, I check ps aux
:
23438 25568 0.0 0.0 119600 48 ? Ss Feb06 0:32 httpd -D NO_DETACH -c Include /app/vendor/heroku/heroku-buildpack-php/conf/apache2/heroku.conf
23438 25569 0.0 0.0 867316 276 ? Sl Feb06 2:13 httpd -D NO_DETACH -c Include /app/vendor/heroku/heroku-buildpack-php/conf/apache2/heroku.conf
23438 25570 0.0 0.0 867316 0 ? Sl Feb06 2:13 httpd -D NO_DETACH -c Include /app/vendor/heroku/heroku-buildpack-php/conf/apache2/heroku.conf
23438 25571 0.0 0.2 867316 1160 ? Sl Feb06 2:13 httpd -D NO_DETACH -c Include /app/vendor/heroku/heroku-buildpack-php/conf/apache2/heroku.conf
The httpd is using almost 0 memory which is good and which I want to achieve. Their configs are here: https://github.com/heroku/heroku-buildpack-php/blob/bd3e49808b0889c1f9f2a582d8b9ccdb8c4f60db/conf/apache2/httpd.conf.default but it's pretty standard. When I use the same config on my Docker image with Apache compiled from source and php working via php-fpm, my httpd process uses more memory
root 2391 0.0 1.4 119624 7400 ? Ss 17:08 0:00 /app/.my/php/sbin/httpd -D NO_DETACH -c Include /app/.my/config/my.conf
www-data 2464 0.0 0.9 408588 4880 ? Sl 17:08 0:00 /app/.my/php/sbin/httpd -D NO_DETACH -c Include /app/.my/config/my.conf
www-data 2465 0.0 0.9 408588 4880 ? Sl 17:08 0:00 /app/.my/php/sbin/httpd -D NO_DETACH -c Include /app/.my/config/my.conf
www-data 2466 0.0 0.9 408588 4880 ? Sl 17:08 0:00 /app/.my/php/sbin/httpd -D NO_DETACH -c Include /app/.my/config/my.conf
And I don't think it's anything to do with php, because I have another image where php is served via mod_php and it is the same:
root 27661 0.0 0.0 4448 0 ? S Feb07 0:00 /bin/sh /usr/local/apache2/bin/apachectl -D FOREGROUND
root 27663 0.0 0.0 248692 216 ? S Feb07 0:29 /usr/local/apache2/bin/httpd -D FOREGROUND
www-data 27664 0.0 1.0 1056472 5312 ? Sl Feb07 2:15 /usr/local/apache2/bin/httpd -D FOREGROUND
www-data 27665 0.0 1.1 1056472 5688 ? Sl Feb07 2:15 /usr/local/apache2/bin/httpd -D FOREGROUND
www-data 27666 0.0 1.1 1056472 5552 ? Sl Feb07 2:14 /usr/local/apache2/bin/httpd -D FOREGROUND