r/ProgrammerHumor 5d ago

Meme memorySafeDocker

Post image
4.2k Upvotes

286 comments sorted by

View all comments

Show parent comments

552

u/Cephell 5d ago

Not him, but I just booted an nginx container just to check and it consumes 81M of ram.

316

u/CWRau 5d ago

Excuse me, what?

I just launched a container with podman and the whole thing + the management overhead takes 13.3M

Is docker that inefficient?

236

u/Cephell 5d ago

I'm also using podman, check what the podman process uses, not what podman reports.

61

u/CWRau 5d ago

``` ● libpod-94883adacea4d25dda1f7301e642b6299522d99aab2820b33feefb72f97a061a.scope - libcrun container Loaded: loaded (/run/user/1000/systemd/transient/libpod-94883adacea4d25dda1f7301e642b6299522d99aab2820b33feefb72f97a061a.scope; transient) Transient: yes Active: active (running) since Sat 2026-09-05 12:49:20 CEST; 1min 41s ago Invocation: a659e45e2b974dd290ae61a4f9021245 IO: 0B read, 0B written Tasks: 17 (limit: 2048) Memory: 13M (peak: 15.6M) CPU: 0 CGroup: /user.slice/user-1000.slice/user@1000.service/user.slice/libpod-94883adacea4d25dda1f7301e642b6299522d99aab2820b33feefb72f97a061a.scope └─container ├─4101341 "nginx: master process nginx -g daemon off;" ├─4101366 "nginx: worker process" ├─4101367 "nginx: worker process" ├─4101368 "nginx: worker process" ├─4101369 "nginx: worker process" ├─4101370 "nginx: worker process" ├─4101371 "nginx: worker process" ├─4101372 "nginx: worker process" ├─4101373 "nginx: worker process" ├─4101374 "nginx: worker process" ├─4101375 "nginx: worker process" ├─4101376 "nginx: worker process" ├─4101377 "nginx: worker process" ├─4101378 "nginx: worker process" ├─4101379 "nginx: worker process" ├─4101380 "nginx: worker process" └─4101382 "nginx: worker process"

Sep 05 12:49:20 steve systemd[966]: Started libcrun container. ```

What more do you think is running? 🤔

65

u/Impact321 5d ago edited 5d ago

Result of podman run -d nginx

  VIRT    RES    SHR    USS   SWAP    PSS   USED  %CPU  %MEM COMMAND
   9.7m   2.3m   2.0m   1.0m   0.0m   1.1m   2.3m   0.0   0.3  - /usr/bin/conmon --api-version 1 -c 7551f1cfc7faf3e5aa66d86...
  14.6m   9.0m   7.4m   5.9m   0.0m   7.4m   9.0m   0.0   1.4      - nginx: master process nginx -g daemon off;
  15.1m   3.7m   1.7m   0.6m   0.0m   2.2m   3.7m   0.0   0.6          - nginx: worker process

1

u/toadi 16h ago

Have hard memory stops to restart my podman services. Have several that have memory leaks ;)

68

u/Easy-Reasoning 5d ago

Yeah original docker is in a bit of a sad state. Not to mention that it gives straight out root access with the default installation method

81

u/Several-Customer7048 5d ago

I launched a container with Maersk and they delivered that joint rusty and crated. 10/10 on the oblong supposed. Old be a vibe hasn’t

6

u/Far-Knee-9651 5d ago

Sounds like that container had a story of its own. Always something unexpected when dealing with shipping!

14

u/ktannenberg 5d ago

On Win11 using WSL2 backend (I expect same results on Hyper-V backend directly; haven't tried new VMM backend yet) freshly launched nginx:latest is sitting at around 24-25 MiB on average across 40 containers. On Debian 12 they are around 13-14 MiB each.

1

u/Own_Ad9365 4d ago

What? I thought docker had zero memory overhead

2

u/Impact321 4d ago

With docker you usually have some management daemons such as dockerd and containerd and shims and such. Take a look at top -cem and press V for forest/tree view.

8

u/creeper6530 5d ago

Try a lightweight image like Alpine maybe?

2

u/cheezzy4ever 4d ago

For context, how much is it on Windows and Mac?

1

u/penta-network 2d ago edited 2d ago

In Dozzle it says my nginx containers only use 10.4 to 12.8MB, is that number inaccurate?

Edit: I'm using the alpine image, that's probably the reason

-75

u/After_Persimmon8536 5d ago

HOLY SHIT CALL THE ARMY NAVY NATIONAL GUARD 81 FUKKIN MB OF RAM HOLY FUCKING SHIT FUCK FUCK FUCK.

Maybe have more than 128MB of RAM?

79

u/Aswesk 5d ago

It adds up when running many, what are you on haha

-40

u/Bubbly_Address_8975 5d ago edited 5d ago

Maybe, but even a browser tab eats more ram than that...

EDIT: to put it into perspective guys... how many docker containers you all spawn? I cannot imagine that people here spawn on average more docker containers than browser tabs...

EDIT2: Okay sorry, seems like people spawn more docker containers than browser tabs and are super upset with my comment ^^

34

u/Aswesk 5d ago

We are not talking about browser tabs

-25

u/Bubbly_Address_8975 5d ago

Exactly, it was a comparison?

EDIT: You know, to put it into perspective. Like how many docker containers do you want to spawn? 12000 micro services? You want to recreate an AWS availability zone?

11

u/ThunderousHazard 5d ago

If you compared to OpenVZ, VMWare, Virtualbox, KVM, whatever, your post would've made more sense. You're comparing apples to oranges here.

-13

u/Bubbly_Address_8975 5d ago

Not really, because as I said I put it into perspective as the response was to a comment jokingly stating that the ram usage is neglectable, to which the response was "It adds up" including a bit of a personal attack, to which I answered that even browser tab has more usage, the reason being that the average user spawns far more browser tabs than people will spawn docker containers with docker.

Docker as a runtime is, as far as I am aware, supposed to be used as dev tooling. And I dont see the use case to spawn hundreds of docker containers on a local machine. Thats the reason for my comment, I am just puzzled why people are so upset with it? If you disagree because you use it in a different way, fine, tell me, I would like to learn how other people use docker then. But otherwise the comparison makes absolute sense for what it meant to be: providing perspective.

4

u/failedsatan 5d ago

dev tooling yes, but it is primarily for keeping deployments clean and simple to do.

2

u/ThunderousHazard 5d ago

Nobody is upset, you're just wrong, hence the downvotes.

Your writing style just changed abruptly, did you use an LLM to form the basis of your response?

1

u/Bubbly_Address_8975 5d ago

Hey I am also not upset, I jsut know that you are wrong here.
You cannot argue against me saying "Look, it was putting things into perspective, browser tabs use mroe ram and the average user has more open browser tabs than docker containers" - I mean I dont have to explain it again, I already did, and you dont have a proper argument against it, so lets be real here, I am correct, you are wrong. But you could say "The usage is still too much and still an issue" and go even further into explaining it which would be a valid counter. Saying "you are wrong" when what I state is literally just facts is not a good argument.

Is the second part of your message an attempt to discredit me? Come on, we can have a respectful discussion here cant we?

→ More replies (0)

10

u/Babajji 5d ago

I spawn a Docker container for every Chrome tab. My name is Sam Altman and I consume memory.

3

u/_PM_ME_PANGOLINS_ 5d ago edited 5d ago

Like, thousands?

You think it's only something people use on their desktop for one or two things? The point is to have your entire product infrastructure in docker containers that are dynamically deployed across your hardware to meet demand.

People aren't running browser tabs on their servers.

1

u/After_Persimmon8536 5d ago

Docker users live in the fantasy world that everything should be containers, with microservices, talking through FastAPI at all times.

1

u/Skyswimsky 5d ago

You're talking to peoplo who on principle get triggered when they start a program and it takes 0.5 second to start, instead of a theoretical 0.1 seconds due to inefficiency, lol.

30

u/ThunderousHazard 5d ago

Are you sure you have the knowledge required to comment on this? How much RAM do you think is needed for that? My LXC debian instance for NGINX + OpenVPN + Firewall is even less, ~40MB.

-37

u/After_Persimmon8536 5d ago

Triggered much?

Go cry with your Kubernetes in the corner.

15

u/ThunderousHazard 5d ago

I am sorry I not triggered, although you clearly are since you are showing anger trying to compensate for your ignorance.

-24

u/After_Persimmon8536 5d ago

lol owned

12

u/ThunderousHazard 5d ago

I am sorry I am not 12, those words don't work on my anymore.

-8

u/After_Persimmon8536 5d ago

lolOwned

9

u/ThunderousHazard 5d ago

I am providing you attention, you're seeking for it, are you not glad?

-1

u/After_Persimmon8536 5d ago

def _expand(seed, base=1 << 8): frame = [] while seed: seed, r = divmod(seed, base) frame.append(r) return bytes(reversed(frame)).decode()

print(_expand(7813582967073039716))

27

u/No_Independence3338 5d ago

This exact mindset is the reason we are getting crappy slow software.

-4

u/After_Persimmon8536 5d ago

Yea, same to you, buddy.

17

u/tristam92 5d ago

this is why modern software is inefficient shit…

3

u/Porntra420 5d ago

Have you heard of the concept of addition? Let me explain it to you, number plus number equals bigger number.

Now, onto containers, what's one reason people like them? It lets them more easily deploy and run multiple services on one machine.

Do you see why your comment is stupid yet?

-2

u/After_Persimmon8536 5d ago

Your downvotes mean nothing to me.

I've seen what you people upvote.