RedHatOfficial / openemr-kube

OpenShift/Kube deployment info for OpenEMR (https://www.open-emr.org/)
11 stars 13 forks source link

Investigate separating webserver and php into separate containers #22

Open bostrt opened 4 years ago

bostrt commented 4 years ago

I've been looking at the upstream Dockerfile (https://github.com/openemr/openemr-devops/blob/master/docker/openemr/5.0.2/Dockerfile). OpenEMR is using the Prefork MPM for Apache HTTPD but Worker or Event MPM are going to perform much better. Prefork is used because OpenEMR is currently using mod_php and not PHP FPM (mod_php requires Prefork to be used). On top of that, the Dockerfile forces users to use Apache HTTPD when they may prefer NGinx or some other webserver.

We should consider having a PHP FPM container that handles all the PHP "things" and then a webserver container that handles the HTTP "things" and proxies to PHP FPM. Proxying could happen over a unix socket using a shared emptyDir across the containers. This would be a more modern configuration.

I'm no PHP architect so I'm curious for some input from others. I can speak to preferring Worker/Event over Prefork and that it will save a ton of resources as usage of an OpenEMR instance increases.

References:

bostrt commented 4 years ago

Work in https://github.com/RedHatOfficial/openemr-kube/pull/19 is blocked by this We can easily move forward with Prefork while still considering the comment above.