Wordpress project is running so slow might be due to file sharing of Docker Desktop on Mac

Hi There,

I need help with to speed up on page request of my wordpress project running docker on Macbook Sonoma 14.7.1.

The current issue is that it takes 20 to 30 seconds just to load a web page or each request. I think there might be issues related to file I/O or file sharing. However, I have tried the following but still not help:

  • In my docker desktop, v4.35.0, I have selected Apple Virtualization Framework, Use Rosetta and VirtioFS.
  • In my docker-compose where I define volumes, I have used :delegated.
volumes:
      - ${INTRANET_SRC_PATH:-../intranet}:/var/www/src:delegated
      - ./phpmyadmin:/var/www/phpmyadmin

By having above settings as documented or other Mac users suggested, but still not help.

I would be really appreciate for your kind help supporting me on this.

Thanks and regards,
Pirun

As I’m not using anything in Docker Desktop that reads a lot of files, I can’t tell you what is wrong, but what you are using ae actually bind mounts, not volumes. Just to test if the problem is the file sharing, you can try using actual volumes which are inside the virtual machine of Docker Desktop. For that you would need to replace the bind mounts with volumes

and copy the the data into the container using docker cp.

If the file sharing turns out to be slow, you have the following options (which you could try first if you want to):

Thanks @rimelek for your suggestions. But first, I’m not sure how to use Docker Desktop volume for my case. Would you kindly provide some sample code snippet? I know you may not know exactly on my project setup, but based on my given volumes yml above, I guess you would be able to write some sample :slight_smile: . Secondly, I have tried VMM beta, but not help. Last, unfortunately, I’m on free plan which no access to Synchronized Fileshares feature yet. However, I’ll try with the Sync Fileshare as the last choice after trying all the rest.

services:
  some-service:
    volumes:
      - ./bind/mount:/container/path
      - /another/bind/mount:/another/path
      - ~/also/bind/mount:/different/path
      - some_volume:/some/path

volumes:
  some_volume:

some_volume does not correlate to a path on your machine, rather to a volume managed by Docker (technically, also in a path on your machine of course)

Docker Volume are supposed to be faster, but I don’t know if you’d really feel the difference, whether it really is the source of the problem