简体   繁体   English

Windows 10 docker-compose 占用 100% 磁盘使用率

[英]Windows 10 docker-compose takes 100% disk usage

Docker is very slow on windows 10. I followed a lot of the tasks to make the index not run on the folder and tried to speed things up. Docker 在 Windows 10 上非常慢。我执行了很多任务以使索引不在文件夹上运行,并试图加快速度。 The process appears to take up 100% of the CPU, which is fine, but also 100%+ of the disk IO and that is a huge bottleneck.该进程似乎占用了 100% 的 CPU,这很好,但也占用了 100%+ 的磁盘 IO,这是一个巨大的瓶颈。 Tasks that take less than 10 seconds to run on linux or mac are taking upwards of 40 minutes to complete on windows.在 Linux 或 Mac 上运行不到 10 秒的任务在 Windows 上需要 40 分钟以上才能完成。

This is simply not usable in any meaningful way.这根本无法以任何有意义的方式使用。 Is there a reason why docker-compose insists on writing 150MB/s to disk rather than using ram? docker-compose 坚持将 150MB/s 写入磁盘而不是使用 ram 是有原因的吗? I have tons of ram.我有很多公羊。 I could actually store the entire docker-container system in ram and have about 10GB left over.我实际上可以将整个 docker-container 系统存储在 ram 中,还剩下大约 10GB。

BTW, while it is feasible to insist that docker only run on Linux for servers, development has to support windows, linux, and mac.顺便说一句,虽然坚持 docker 只在 Linux 服务器上运行是可行的,但开发必须支持 windows、linux 和 mac。 I cannot believe that testing did not reveal windows 10 support dearly lacking and no, turning off anti-virus is absolutely not an option.我不敢相信测试没有显示 Windows 10 支持严重缺乏,不,关闭防病毒绝对不是一个选择。 Many docker developers do not have the proper permissions to do so and recommending that docker users disable anti-virus is an incredible request.许多 docker 开发人员没有这样做的适当权限,建议 docker 用户禁用防病毒是一个令人难以置信的请求。 Also, disabling anti-virus or the like still does not answer why docker takes up 100% of disk IO.此外,禁用防病毒等仍然无法回答为什么 docker 占用 100% 的磁盘 IO。

I had this same issue with the recent update to 3.0.0 of Docker Desktop for Windows using Hyper-V.我最近使用 Hyper-V 更新到适用于 Windows 的 Docker Desktop 3.0.0 时遇到了同样的问题。

The solution for me was to increase the resources made available to the VM ( Settings -> Resources -> Advanced ).我的解决方案是增加 VM 可用的资源(设置 -> 资源 -> 高级)。 I increased the number of CPUs (from 2 to 4), Memory (1GB to 6GB), Swap (1GB to 2GB) and Disk Space (64GB to 128GB).我增加了 CPU(从 2 个到 4 个)、内存(1GB 到 6GB)、交换(1GB 到 2GB)和磁盘空间(64GB 到 128GB)的数量。 And I have not had the 100% disk usage problem since.从那以后我就再也没有遇到过 100% 磁盘使用率的问题。

So recently I was having the same issue.所以最近我遇到了同样的问题。 I was using Docker with DDEV for a Drupal development environment.我在 Drupal 开发环境中使用 Docker 和 DDEV。 Running composer require drupal/something took many many hours to complete.运行composer require drupal/something需要花费很多时间才能完成。 I tried some of the trouble shooting items on Why is PHP Composer so slow?我尝试了一些关于为什么 PHP Composer 这么慢? . . Specifically, running and using composer global require hirak/prestissimo .具体来说,运行和使用composer global require hirak/prestissimo At least this actually ran.至少这真的跑了。 It was promising.这是有前途的。 It however did not fix the issue.但是,它没有解决问题。 I tried uninstalling an reinstalling DDEV and Docker as suggested by Spiceworks: Docker for windows reach 100% disk usage after win 10 in-place update .我尝试按照Spiceworks 的建议卸载重新安装的 DDEV 和 Docker: Docker for windows reach 100% disk usage after win 10 in-place update This also did not work.这也没有用。 I decided to try ddev composer install outside of the container instead of composer install inside the container.我决定尝试在容器外ddev composer install ,而不是在容器内composer install Composer gave me the error: This host computer is unable to create real symlinks, please see the docs to enable developer mode: Turned on windows development mode and composer started to work as it should. Composer 给我错误: This host computer is unable to create real symlinks, please see the docs to enable developer mode: Turned on windows development mode and composer starts to work as it should.

Solution: Turn on windows developer mode so system links can be used.解决办法:打开windows开发者模式,这样系统链接就可以使用了。

Hope this helps y'all!希望这对大家有帮助!

I have experienced this problem on Windows 10 with the following conditions:我在具有以下条件的 Windows 10 上遇到过此问题:

  1. Start a Jenkins container.启动詹金斯容器。
  2. Setup a Maven build for a project from a Git repository on Jenkins.从 Jenkins 上的 Git 存储库为项目设置 Maven 构建。
  3. Run the build.运行构建。

Build completes just fine.构建完成就好了。

  1. Start a second container with Sonarqube.使用 Sonarqube 启动第二个容器。
  2. Add step to Jenkins to perform Sonar analysis and run the build.向 Jenkins 添加步骤以执行 Sonar 分析并运行构建。

The Jenkins build hangs after some time, disk usage 99-100%, CPU is fine. Jenkins 构建在一段时间后挂起,磁盘使用率 99-100%,CPU 正常。 Docker doesn't respond to any console commands. Docker 不响应任何控制台命令。

Had to restart Docker to fix this.必须重新启动 Docker 才能解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM