Code Monkey home page Code Monkey logo

Comments (2)

gdraheim avatar gdraheim commented on June 23, 2024

As the processes of the services are completely independent one can just exchange the out file-node where to write to. An option may be to use "falloate --punch-hole" to put sparse blocks into the journal.

If one does really want to have a rotatation one could do some "dd" first. However I would prefer to not do such file creation - or even do it like just once a day.

Instead I would like to implement an option where the journal is given a maximum non-sparse value, and everything below is getting punched in the init_loop. That should keep the interruptions rather short - just one hole at a time most of the times.

fallocate --punch-hole --offset 40K --length 4K service.log
# TEST
dd if=/dev/random of=random1.log count=200
dd if=/dev/random of=random2.log count=200
fallocate -p -o 0 -l 12K random1.log
du random*
     16	random2.log
     4	random.log
cat random1.log | od -a | wc -l
    223
cat random2.log | od -a | wc -l
    985
ls -l random*
 -rw-r--r-- 15805 10. Sep 16:02 random1.log
 -rw-r--r-- 15735 10. Sep 16:03 random2.log

from docker-systemctl-replacement.

gdraheim avatar gdraheim commented on June 23, 2024

man fallocate(1)

   -p, --punch-hole
          Deallocates  space  (i.e.,  creates  a hole) in the byte range starting at offset and continuing for length bytes.  Within the specified
          range, partial filesystem blocks are zeroed, and whole filesystem blocks are removed from the file.  After a successful call, subsequent
          reads  from  this  range will return zeroes.  This option may not be specified at the same time as  the --zero-range option.  Also, when
          using this option, --keep-size is implied.

          Supported for XFS (since Linux 2.6.38), ext4 (since Linux 3.0), Btrfs (since Linux 3.7) and tmpfs (since Linux 3.5).

from docker-systemctl-replacement.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.