ionice
This commit is contained in:
parent
37df18f45d
commit
3d4a757917
@ -26,6 +26,8 @@ Sections:
|
|||||||
too quickly. Set this too high, and AtOM will not adapt quickly enough to
|
too quickly. Set this too high, and AtOM will not adapt quickly enough to
|
||||||
load increase. In both cases, your hard drive will suffer. In my
|
load increase. In both cases, your hard drive will suffer. In my
|
||||||
experience, 30 seconds is a good value.
|
experience, 30 seconds is a good value.
|
||||||
|
* ionice <class> [niceness]: IO-hungry processes will be run with ionice class
|
||||||
|
<class> and niceness [niceness] (if applicable). See man ionice for details.
|
||||||
* temporary-directory <directory>: String. Name speaks for itself: this is
|
* temporary-directory <directory>: String. Name speaks for itself: this is
|
||||||
where FIFOs (for communicating with sqlite) and temporary WAVE files will
|
where FIFOs (for communicating with sqlite) and temporary WAVE files will
|
||||||
be created. Note that debug logs (if enabled) will go there too.
|
be created. Note that debug logs (if enabled) will go there too.
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
[general]
|
[general]
|
||||||
|
ionice 3
|
||||||
max-load 6
|
max-load 6
|
||||||
load-interval 30
|
load-interval 30
|
||||||
temporary-directory %HOME%/.atom/tmp
|
temporary-directory %HOME%/.atom/tmp
|
||||||
|
|||||||
@ -23,6 +23,49 @@ getConfigGeneral() {
|
|||||||
fi
|
fi
|
||||||
unset expr
|
unset expr
|
||||||
;;
|
;;
|
||||||
|
'ionice')
|
||||||
|
read class niceness <<<"$value"
|
||||||
|
case $class in
|
||||||
|
1)
|
||||||
|
# real-time class, only root can do that
|
||||||
|
if (( UID ))
|
||||||
|
then
|
||||||
|
echo "IO class 'realtime' is"\
|
||||||
|
"not available to unprivileged"\
|
||||||
|
"users" >&2
|
||||||
|
exit $EIONICE
|
||||||
|
fi
|
||||||
|
if [ -n "$niceness" ] \
|
||||||
|
&& (( niceness >= 0 && niceness <= 7 ))
|
||||||
|
then
|
||||||
|
ionice="ionice -c1 -n$niceness "
|
||||||
|
else
|
||||||
|
echo "Invalid IO priority"\
|
||||||
|
"'$niceness'" >&2
|
||||||
|
exit $EIONICE
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
if [ -n "$niceness" ] \
|
||||||
|
&& (( niceness >= 0 && niceness <= 7 ))
|
||||||
|
then
|
||||||
|
ionice="ionice -c2 -n$niceness "
|
||||||
|
else
|
||||||
|
echo "Invalid IO priority"\
|
||||||
|
"'$niceness'" >&2
|
||||||
|
exit $EIONICE
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
ionice="ionice -c3 "
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Invalid ionice parameters $value"\
|
||||||
|
>&2
|
||||||
|
exit $EIONICE
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
'temporary-directory')
|
'temporary-directory')
|
||||||
tempdir="$value"
|
tempdir="$value"
|
||||||
;;
|
;;
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
printConfig() {
|
printConfig() {
|
||||||
{
|
{
|
||||||
|
echo "General|Config file|$cffile"
|
||||||
|
[ -n "$ionice" ] && echo "|IO Nice|$ionice"
|
||||||
cat <<-EOF
|
cat <<-EOF
|
||||||
General|Config file|$cffile
|
|
||||||
|Load|$maxload
|
|Load|$maxload
|
||||||
|Load Interval|$loadinterval
|
|Load Interval|$loadinterval
|
||||||
|Temp Dir|$tempdir
|
|Temp Dir|$tempdir
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
decodeMpcdec() {
|
decodeMpcdec() {
|
||||||
tmpfile="${fileid}mpcdec"
|
tmpfile="${fileid}mpcdec"
|
||||||
commandline=(mpcdec "$sourcepath/$filename" "$tempdir/$tmpfile.wav")
|
commandline=(${ionice}mpcdec)
|
||||||
|
commandline+=("$sourcepath/$filename" "$tempdir/$tmpfile.wav")
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
decodeOpusdec() {
|
decodeOpusdec() {
|
||||||
tmpfile="${fileid}opusdec"
|
tmpfile="${fileid}opusdec"
|
||||||
commandline=(opusdec "$sourcepath/$filename" "$tempdir/$tmpfile.wav")
|
commandline=(${ionice}opusdec)
|
||||||
|
commandline+=("$sourcepath/$filename" "$tempdir/$tmpfile.wav")
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
decodeSox() {
|
decodeSox() {
|
||||||
commandline=(sox --single-threaded --temp "$tempdir")
|
commandline=(${ionice}sox --single-threaded --temp "$tempdir")
|
||||||
soxoptions_in=''
|
soxoptions_in=''
|
||||||
soxoptions_out=''
|
soxoptions_out=''
|
||||||
if (( ${destinationnormalize["$destination"]} ))
|
if (( ${destinationnormalize["$destination"]} ))
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
encodeFile::mp3() {
|
encodeFile::mp3() {
|
||||||
lameopts=(lame --quiet -v --abr ${destinationquality[$destination]})
|
lameopts=(${ionice}lame --quiet)
|
||||||
|
lameopts+=(-v --abr ${destinationquality[$destination]})
|
||||||
[ -n "$album" ] && lameopts+=(--tl "$album" )
|
[ -n "$album" ] && lameopts+=(--tl "$album" )
|
||||||
[ -n "$artist" ] && lameopts+=(--ta "$artist")
|
[ -n "$artist" ] && lameopts+=(--ta "$artist")
|
||||||
[ -n "$genre" ] && lameopts+=(--tg "$genre")
|
[ -n "$genre" ] && lameopts+=(--tg "$genre")
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
encodeFile::opus() {
|
encodeFile::opus() {
|
||||||
opusencopts=(opusenc --music --quiet)
|
opusencopts=(${ionice}opusenc --music --quiet)
|
||||||
opusencopts+=(--bitrate ${destinationquality[$destination]})
|
opusencopts+=(--bitrate ${destinationquality[$destination]})
|
||||||
[ -n "${destinationloss["$destination"]}" ] \
|
[ -n "${destinationloss["$destination"]}" ] \
|
||||||
&& opusencopts+=(--expect-loss "${destinationloss["$destination"]}")
|
&& opusencopts+=(--expect-loss "${destinationloss["$destination"]}")
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
encodeFile::vorbis() {
|
encodeFile::vorbis() {
|
||||||
oggencopts=(oggenc -Q -q ${destinationquality[$destination]})
|
oggencopts=(${ionice}oggenc -Q -q ${destinationquality[$destination]})
|
||||||
[ -n "$albumartist" ] && oggencopts+=(-c "ALBUMARTIST=$albumartist")
|
[ -n "$albumartist" ] && oggencopts+=(-c "ALBUMARTIST=$albumartist")
|
||||||
[ -n "$album" ] && oggencopts+=(-l "$album")
|
[ -n "$album" ] && oggencopts+=(-l "$album")
|
||||||
[ -n "$artist" ] && oggencopts+=(-a "$artist")
|
[ -n "$artist" ] && oggencopts+=(-a "$artist")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user