amir20 / dozzle

Realtime log viewer for docker containers.
https://dozzle.dev/
MIT License
5.7k stars 287 forks source link

System becomes irresponsive, 100% resource utilization if high container count #3140

Closed mistrello96 closed 1 month ago

mistrello96 commented 1 month ago

Check for existing issues

How is Dozzle deployed?

Standalone Deployment

Dozzle version

8.0.6 (but tried also previous versions)

✅ Command used to run Dozzle

docker compose up -d

using this DC

services:
  dozzle:
    container_name: dozzle
    image: amir20/dozzle:latest
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

Describe the performance issue you are seeing

As soon as i run the container, the CPU usage peaks at 100% and the RAM starts to fill up. The system becomes irresponsive and the only solution is a force reboot. No anomalies in Dozzle logs

Relevant issue #3085

How many containers, hosts, agents, etc. are you using?

30 active container, 30000 stopped containers with few lines of log (1/2) per container

Screenshots, videos, or logs

log.txt

mistrello96 commented 1 month ago

I think the most dangerous part of this issues is that it impacts the whole system, potentially making it crash . This should be prevented, maybe preventing dozzle to start the loop referrend in 3085 if the number of container is above a certain threshold

amir20 commented 1 month ago

I was under the impression this was the browser freezing. Maybe it is something in backend code then. Yea, I agree that needs to be fixed. I have a hunch.

mistrello96 commented 1 month ago

I was under the impression this was the browser freezing. Maybe it is something in backend code then. Yea, I agree that needs to be fixed. I have a hunch.

Yep, the whole server hosting dozzle freezes and need a force reboot, not the browser client

amir20 commented 1 month ago

I think amir20/dozzle:pr-3144 should greatly improve the performance issue. I was fetching meta data for all containers. Now I only do it if the container is running. But the problem, I guess it is possible to have 1000 running containers. Need to think about it.

amir20 commented 1 month ago

I made some more improvements. I think it's at a good place now. So I can merge tomorrow. I am not sure if you can test it out.

mistrello96 commented 1 month ago

I'm sorry but since I removed the stopped container, I cannot test this behaviour anymore

amir20 commented 1 month ago

Ok then I'll merge for now. We just have to revisit it again if it happens.