Skip to content
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

Warn if Docker is likely to encounter swap issues (performance impact) #8892

Closed
medyagh opened this issue Jul 30, 2020 · 5 comments · Fixed by #9144 or #9149
Closed

Warn if Docker is likely to encounter swap issues (performance impact) #8892

medyagh opened this issue Jul 30, 2020 · 5 comments · Fixed by #9144 or #9149
Labels
co/docker-driver Issues related to kubernetes in container kind/feature Categorizes issue or PR as related to a new feature. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.

Comments

@medyagh
Copy link
Member

medyagh commented Jul 30, 2020

we correcelty and nicely warn the user that their docker desktop is low on memory but still when we are Erroring, we spit out ugly messages... I suspect we could add a regex to this and make sure if this ever happens, hint to the user what is going on.

medya@~/workspace/minikube (crio_17_3) $ ./out/minikube start --driver=docker --base-image=local/kicbase:v0.0.10-snapshot
😄  minikube v1.12.1 on Darwin 10.15.6
✨  Using the docker driver based on user configuration
❗  Requested memory allocation (1739MB) is less than the recommended minimum 2000MB. Kubernetes may crash unexpectedly.
❗  Increase Docker for Desktop memory to at least 2.5GB or more:

        Docker for Desktop > Settings > Resources > Memory


👍  Starting control plane node minikube in cluster minikube
🔥  Creating docker container (CPUs=2, Memory=1739MB) ...
✋  Stopping "minikube" in docker ...
🔥  Deleting "minikube" in docker ...
🤦  StartHost failed, but will try again: creating host: create: creating: create kic node: container name "minikube": log: 2020-07-30T17:16:31.009963700Z  546 535 0:39 /docker/af9f0def1ca7ccd9b72c4da5e42395e3f6ab4ecb136893e606b5e1088a02bbba /sys/fs/cgroup/hugetlb rw,nosuid,nodev,noexec,relatime shared:148 master:28 - cgroup hugetlb rw,hugetlb
2020-07-30T17:16:31.010339600Z  547 535 0:40 /docker/af9f0def1ca7ccd9b72c4da5e42395e3f6ab4ecb136893e606b5e1088a02bbba /sys/fs/cgroup/pids rw,nosuid,nodev,noexec,relatime shared:149 master:29 - cgroup pids rw,pids
2020-07-30T17:16:31.010378100Z  549 535 0:42 /docker/af9f0def1ca7ccd9b72c4da5e42395e3f6ab4ecb136893e606b5e1088a02bbba /sys/fs/cgroup/systemd rw,nosuid,nodev,noexec,relatime shared:151 master:31 - cgroup cgroup rw,name=systemd'
2020-07-30T17:16:31.012576500Z  + docker_cgroup=/docker/af9f0def1ca7ccd9b72c4da5e42395e3f6ab4ecb136893e606b5e1088a02bbba: container exited unexpectedly
@medyagh medyagh added needs-solution-message Issues where where offering a solution for an error would be helpful priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. labels Jul 30, 2020
@afbjorklund afbjorklund added co/docker-driver Issues related to kubernetes in container kind/feature Categorizes issue or PR as related to a new feature. labels Aug 5, 2020
@afbjorklund
Copy link
Collaborator

Seems like we invest more in docker desktop support than on kubernetes recently

@briandealwis
Copy link
Contributor

It would also be good to use the appropriate mappings per platform. On macOS it should be

Docker > Preferences > Resources > Memory

@briandealwis
Copy link
Contributor

Two other things I noticed:

  • A similar strings has two spaces between Docker Desktop and Settings:
    "Your system has {{.system_limit}}MB memory but Docker has only {{.container_limit}}MB. For a better performance increase to at least 3GB.\n\n\tDocker for Desktop \u003e Settings \u003e Resources \u003e Memory": "",
  • A similar string uses Docker icon:
    "Your Docker Desktop has less than 2 CPUs. Increase CPUs for Docker Desktop. \n\t\n\tDocker icon \u003e Settings \u003e Resources \u003e CPUs": "",

@briandealwis
Copy link
Contributor

A futher note: my memory settings were 2GB, resulting in the following warning:

❗  Increase Docker for Desktop memory to at least 2.5GB or more:
			
	Docker for Desktop > Settings > Resources > Memory


❗  Requested memory allocation (1990MB) is less than the recommended minimum 2000MB. Kubernetes may crash unexpectedly.
❗  Your system has 16384MB memory but Docker has only 1990MB. For a better performance increase to at least 3GB.

	Docker for Desktop  > Settings > Resources > Memory


These warnings use two different recommended values, and I dutifully used the first value (2.5GB).

@tstromberg
Copy link
Contributor

Fixed at head by #9126:


⛔  Exiting due to RSRC_DOCKER_MEMORY: Docker Desktop only has 984MiB available, less than the required 1024MiB for Kubernetes
💡  Suggestion: 

    1. Click on "Docker for Desktop" menu icon
    2. Click "Preferences"
    3. Click "Resources"
    4. Increase "Memory" slider bar to 2.25 GB or higher
    5. Click "Apply & Restart"
📘  Documentation: https://docs.docker.com/docker-for-mac/#resources

@tstromberg tstromberg removed the needs-solution-message Issues where where offering a solution for an error would be helpful label Sep 1, 2020
@tstromberg tstromberg reopened this Sep 1, 2020
@tstromberg tstromberg changed the title improve error message even more when docker-desktop memory is lower than 2 GB Warn if Docker is likely to encounter swap issues (performance impact) Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/docker-driver Issues related to kubernetes in container kind/feature Categorizes issue or PR as related to a new feature. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Projects
None yet
4 participants