eroji / rtsp2mjpg

RTSP to MJPEG stream conversion using FFmpeg and FFserver
99 stars 41 forks source link

Script fill ups disk #8

Closed cristiancs closed 3 years ago

cristiancs commented 4 years ago

[root@localhost ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/centos-root 86G 31G 55G 36% /

[root@localhost rtsp-camara2]# docker-compose down [root@localhost rtsp-camara2]# docker-compose up -d

Filesystem Size Used Avail Use% Mounted on /dev/mapper/centos-root 86G 9.5G 76G 12% /

This is after about 2 months of use

eroji commented 4 years ago

Did you get a chance to see what inside the container is occupying the space? I'm guessing it has to do with the temp file ffserver is writing to /tmp/feed.ffm but I can't confirm.

cristiancs commented 4 years ago

I was not sure what file could be, i just checked /tmp/feed.ffm but it weights 50.0M as expected

bash-4.4# ls -lah
total 65472
drwxrwxrwt    1 root     root          22 Jun 23 16:50 .
drwxr-xr-x    1 root     root          28 Jun 23 16:50 ..
-rw-r--r--    1 root     root       50.0M Jun 23 18:44 feed.ffm
eroji commented 4 years ago

Yea that looks as expected, however you did do a docker-compose down so that would've blown away anything in tmp if it was there. That's the only thing I can think of that may be consuming disk space. There shouldn't be anything else that needs to write to perform the video transcode.

cristiancs commented 4 years ago

Other thing that can affect is the log, i checked with:

sudo sh -c "du -ch /var/lib/docker/containers/*/*-json.log"

And

7.7G    /var/lib/docker/containers/8...log

So i added

logging:
      options:
    max-size: "10m"
        max-file: "3"

to the docker-compose.yaml and looks like now it's working well.

eroji commented 3 years ago

Thank you. I added your suggested changes to the yaml.