forked from zzhou1/fstrim-throttle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
40 lines (33 loc) · 1.97 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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