Skip to content

Slowness on Windows environments due to Docker volume performance for MySQL / Lentitud en entornos Windows debido al rendimiento de volúmenes Docker para MySQL #1

@raulfg

Description

@raulfg

English

Problem Description

It has been observed that the Docker Compose environment for WordPress can experience significant slowness on Windows operating systems, especially during the initial WordPress installation or when performing database-intensive operations.

The primary cause seems related to Docker's volume performance on Windows when mapping host filesystem directories (NTFS) to Linux containers (where MySQL runs). Disk I/O for the MySQL database, which resides in the local ./data/ folder, becomes a bottleneck.

Steps to Reproduce (if applicable)

  1. Set up the environment on a Windows machine (without WSL2 or with WSL2 but with the project on the Windows filesystem).
  2. Run docker-compose up -d.
  3. Attempt to install WordPress or navigate the backend.
  4. Observe longer-than-expected load times compared to Linux or macOS environments.

Environment

  • Operating System: Windows (especially versions without WSL2 or with the project outside the WSL2 filesystem)
  • Docker Desktop for Windows:

Potential Solutions or Mitigations (to investigate)

  • Use WSL2 (Windows Subsystem for Linux 2): Storing the project and data (./data/, ./www/) within the WSL2 Linux distribution's filesystem generally offers much better I/O performance.
  • Docker Named Volumes: Instead of bind mounts to ./data/, using Docker named volumes could be explored, although this might affect the direct portability of data files if one wishes to move them manually.
  • MySQL Configuration Optimization: Investigate if specific MySQL parameters can mitigate I/O issues in this context (though the root problem is likely at the filesystem/Docker level).

Impact

The development experience on Windows can be frustrating due to slowness, affecting productivity.


This issue is created to document the problem and explore potential solutions or warnings for Windows users.



Español

Descripción del Problema

Se ha observado que el entorno Docker Compose para WordPress puede experimentar una notable lentitud en sistemas operativos Windows, especialmente durante la instalación inicial de WordPress o al realizar operaciones intensivas de base de datos.

La causa principal parece estar relacionada con el rendimiento de los volúmenes de Docker en Windows cuando se mapean directorios del sistema de archivos host (NTFS) a contenedores Linux (donde se ejecuta MySQL). La E/S (entrada/salida) de disco para la base de datos MySQL, que reside en la carpeta local ./data/, se vuelve un cuello de botella.

Pasos para Reproducir (si aplica)

  1. Configurar el entorno en una máquina Windows (sin WSL2 o con WSL2 pero con el proyecto en el sistema de archivos de Windows).
  2. Ejecutar docker-compose up -d.
  3. Intentar instalar WordPress o navegar por el backend.
  4. Observar tiempos de carga más largos de lo esperado en comparación con entornos Linux o macOS.

Entorno

  • Sistema Operativo: Windows (especialmente versiones sin WSL2 o con el proyecto fuera del sistema de archivos de WSL2)
  • Docker Desktop para Windows:

Posibles Soluciones o Mitigaciones (a investigar)

  • Usar WSL2 (Windows Subsystem for Linux 2): Almacenar el proyecto y los datos (./data/, ./www/) dentro del sistema de archivos de la distribución Linux en WSL2 generalmente ofrece un rendimiento de E/S mucho mejor.
  • Volúmenes Nombrados de Docker: En lugar de bind mounts a ./data/, se podría explorar el uso de volúmenes nombrados de Docker, aunque esto podría afectar la portabilidad directa de los archivos de datos si se quieren mover manualmente.
  • Optimización de configuración de MySQL: Investigar si hay parámetros específicos de MySQL que puedan mitigar problemas de E/S en este contexto (aunque es probable que el problema principal sea a nivel de sistema de archivos/Docker).

Impacto

La experiencia de desarrollo en Windows puede ser frustrante debido a la lentitud, afectando la productividad.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions