Container Role Configuration to Optimize Resource Utilization and Reduce Memory Usage #215
-
Hi guys, I am utilizing the
This architecture facilitates individual scaling of each component on Kubernetes. However, I've observed that nginx and PHP-FPM are initialized in every container, which significantly increases the Memory usage, especially when managing numerous Laravel instances. To mitigate this, I've resorted to creating two unique images:
This workaround, albeit functional, introduces a complex initial build configuration and heightens the potential for failure due to the need to manage multiple images. In the past, I've employed a container role concept. Despite the image having the capability to host the webapp, assigning a role like I am inquiring if a similar container role feature could be envisaged for future releases, to streamline resource utilization, reduce Memory usage, and simplify image management. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
In our use case, we do the same thing. We use Optimizing servers is very unique to every application. In the case if you do not want to use the method above, you will need to use an This will require extra work where you'll need to ensure you have a load balancer and/or HTTP server outside of your PHP Containers and you'll need to make sure the static assets are stored in an accessible location for all containers. Hope this helps! |
Beta Was this translation helpful? Give feedback.
In our use case, we do the same thing. We use
fpm-nginx
multiple times (even for things like Queue and Scheduler). In our case this works fine. An app with a similar structure runs on a server running 2GB of RAM and 1 CPU.Optimizing servers is very unique to every application. In the case if you do not want to use the method above, you will need to use an
FPM
image only and ensure that your server is only processing PHP requests.This will require extra work where you'll need to ensure you have a load balancer and/or HTTP server outside of your PHP Containers and you'll need to make sure the static assets are stored in an accessible location for all containers.
Hope this helps!