RayJ_inSJ
RayJ_inSJ

Reputation: 337

How to see memory allotment for Docker Engine?

Setting up a docker instance of Elasticsearch Cluster. In the instructions it says
Make sure Docker Engine is allotted at least 4GiB of memory

I am ssh'ing to the host, not using docker desktop. How can I see the resource allotments from the command line?

reference URL https://www.elastic.co/guide/en/elastic-stack-get-started/current/get-started-docker.html

Upvotes: 5

Views: 3576

Answers (2)

Agit Kaplan
Agit Kaplan

Reputation: 51

I had same problem, with Docker Desktop on Windows 10 while running Linux containers on WSL2.

I found this issue: https://github.com/elastic/elasticsearch-docker/issues/92 and tried to apply similar logic to the solution of there.

I entered the WSL instance's terminal by wsl -d docker-desktop command. Later I run sysctl -w vm.max_map_count=262144 command to set 'allotted memory'.

After these steps I could run elasticsearch's docker compose example.

Upvotes: 3

Connor Verlekar
Connor Verlekar

Reputation: 97

I'd like to go about it by just using one command.

 docker stats -all

This will give a output such as following

$ docker stats -all

CONTAINER ID        NAME           CPU%  MEM USAGE/LIMIT   MEM%   NET I/O BLOCK I/O PIDS
5f8a1e2c08ac my-compose_my-nginx_1 0.00% 2.25MiB/1.934GiB 0.11% 1.65kB/0B 7.35MB/0B  2

To modify the limits : when you're making your docker-compose.yml include the following at the end of your file. (if you'd like to set up a 4 GiB limit)

resources:
limits:
memory: 4048m
reservations:
memory: 4048m

Upvotes: -2

Related Questions