Code Monkey home page Code Monkey logo

fstrim-throttle's Introduction

usage: nice_trim.py [-h] [-a] [-b] [-d] [-v]

A wrapper of fstrim. It runs fstrim in chunks and sleep in between.

It intends to throttle fstrim and leave the room for the normal WRITE request
IO to get through to the backend block device. A plain fstrim might initiate
DISCARD requests, disturb ongoing IO too much, cause the long freeze, and harm
the critical service.

The human readable format includes K/KiB, M/MiB, G/GiB, T/TiB, KB, MB, GB, TB.

optional arguments:
  -h, --help     show this help message and exit
  -a, --all      auto-detect all trimmable. This overrides any mount point
  -b, --bytes    print SIZE in bytes rather than in human readable format
  -d, --debug    debugging information
  -v, --verbose  duplicate the log INFO to STDOUT as well

information options:
  
  mount_point    mount points we are trimming. Internally, fstrim will convert any
                 directory path to the corresponding mount point or block device.
  -c, --chunk-size <bytes>
                 to search for free blocks to discard. kernel will internally
                 round it up to a multiple of the filesystem block size. Also
                 this tool will round it up to the filesystem block size to avoid
                 fstrim error report if too small (default: 4GiB)
  -m, --min-extent <bytes>
                 the minimum contiguous free range to discard. kernel will
                 internally round it up to a multiple of the filesystem block
                 size. Zero is to discard every free block (default: 16MiB)
  -s, --sleep-range <min,max> in seconds (default: 0.5)
                 MIN would give a reasonable sleep between fstrim chunks.
                 MAX would give a bigger random sleep to avoid all virtual machines or
                 physical machines to stress the storage system all at once.
                 eg. a random range '0.5,600'
                 eg. 0.5 is equal to '0.5,0.5'
  -l, --log-file <path> (default: /var/log/nice_trim.log)

Example: nice_trim.py -a

fstrim-throttle's People

Contributors

mheler avatar moloney avatar zzhou1 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.