-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speed up PHP-fpm container on MacOS #568
base: 1.12
Are you sure you want to change the base?
Conversation
5e74470
to
22a1445
Compare
In the environment with Of course, it depends on your workstation and the resources available for the containers. Therefore, I got a better experience in the local environment with these changes. Always the first request took more time than I mentioned above, it is because the PHP is caching code on opcache and Symfony generating the cache files. |
22a1445
to
9462465
Compare
9462465
to
a786874
Compare
a786874
to
4de48ed
Compare
Many MacOS users may be facing slow responses from Shop or Admin when running the sylius application in the container. The main reason is how docker was build in the MacOS architecture. The PHP application has thousands of files to be loaded in memory (vendor directory mainly). So, to decrease the page response time, the vendor directory is not synced into the container. It will be ignored by docker-composer.yml using the named volume. Also, was added a health check for the PHP-fpm container to know when it is ready. If you want to check healthiness, just run the command `docker-compose ps` to see the container State. The HEALTHCHECK instruction tells Docker how to test a container to check that it is still working. This can detect cases such as a web server stuck in an infinite loop and unable to handle new connections, even though the server process is still running. The PHP and PHP-FPM configurations received some adjustments to get better support development environment experience using containers. I did pick up these updates from two other contributors that I co-authored in this commit. Co-authored-by: Kévin Dunglas <[email protected]> Co-authored-by: arti0090 <[email protected]>
4de48ed
to
ca7781f
Compare
The container image was ignoring the dotenv config to build the PHP container image.
@vvasiloi I fix the typos 😊 |
I keep using the wrong account... |
@Arminek can you take a look into this? |
It's a nice improvement, but with the latest Docker Desktop filesystem, there is no need for performance improvement. https://www.docker.com/blog/speed-boost-achievement-unlocked-on-docker-desktop-4-6-for-mac/ I don't mind keeping the health checks in the environment :) |
@Ferror Docker for mac still has some issues unresolved :). But soonish I hope! |
Many MacOS users may be facing slow responses from Shop or Admin when
running the sylius application in the container. The main reason is how
docker was build in the MacOS architecture. The PHP application has
thousands of files to be loaded in memory (vendor directory mainly).
So, to decrease the page response time, the vendor directory is not
synced into the container. It will be ignored by docker-composer.yml
using the named volume.
Also, was added a health check for the PHP-fpm container to know when it
is ready. If you want to check healthiness, just run the command
docker-compose ps
to see the container State.The HEALTHCHECK instruction tells Docker how to test a container
to check that it is still working. This can detect cases such as a
web server stuck in an infinite loop and unable to handle new
connections, even though the server process is still running.
The PHP and PHP-FPM configurations received some adjustments to get
better support development environment experience using containers.
I did pick up these updates from two other contributors that I
co-authored in this commit.
Co-authored-by: Kévin Dunglas [email protected]
Co-authored-by: arti0090 [email protected]