Speed up mpd start on rpi zero w
Posted: January 11th, 2021, 1:41 pm
Dear all,
I am trying to speed up the mpd start on an phonibox installation using mpd on a rpi zero w.
I searched around in the forum, and I already got some improvements:
- disabled auto-update
- compiled actual mpd version on the target (0.23)
- starting network after mpd
- avoid parallel starting of other services in parallel to mpd
The biggest influence I think was the new version, and of course the more or less unique execution (CPU load during mpd start is up to 95%, and its a single core).
so with all that I came down from 26s for mpd to now about 8 sec.
But still 8 sec! (What the hell is mpd doing here, bitcoin mining?)
So my question is, does anybody see some further improvements I can make?
Possibly there are some features I don't need and I can disable them either by configuration, build settings or even code modifications.
I hope this already helps, I made an strace of a manual mpd start:
https://paste.ubuntu.com/p/rbYjzKJThz/
what is obvious an consistence over 3 traces the delay before the last call to clock_gettime, which take between somehow 3!
There are also other call to clock_gettime where you can observe an delay. The pattern is identical between the traces.
Then there are some call to mprotect, with some delay, also identical pattern.
btw, this are the error messages I get:
exception: Default TCP listener setup failed, but this is okay because we have a $XDG_RUNTIME_DIR listener: Failed to bind to '[::]:6600'
exception: Failed to bind socket: Address already in use
exception: Unrecognized tag 'Conductor', discarding database file
exception: Input plugin 'tidal' is unavailable: No Tidal application token configured
exception: Input plugin 'qobuz' is unavailable: No Qobuz app_id configured
tidal and qobuz I disabled in the configuration, as well as port settings (I understood there is an service mpd.socket taking care of this,) anyway, it is working.
Remark:
During compilation I got the warning of an outdated libboost 1.67 which is known as buggy.
As far as I tried upgrading libboost will be nightmare on this target, so I would prefer to deal with the outdated version.
br
Arne
I am trying to speed up the mpd start on an phonibox installation using mpd on a rpi zero w.
I searched around in the forum, and I already got some improvements:
- disabled auto-update
- compiled actual mpd version on the target (0.23)
- starting network after mpd
- avoid parallel starting of other services in parallel to mpd
The biggest influence I think was the new version, and of course the more or less unique execution (CPU load during mpd start is up to 95%, and its a single core).
so with all that I came down from 26s for mpd to now about 8 sec.
But still 8 sec! (What the hell is mpd doing here, bitcoin mining?)
So my question is, does anybody see some further improvements I can make?
Possibly there are some features I don't need and I can disable them either by configuration, build settings or even code modifications.
I hope this already helps, I made an strace of a manual mpd start:
https://paste.ubuntu.com/p/rbYjzKJThz/
what is obvious an consistence over 3 traces the delay before the last call to clock_gettime, which take between somehow 3!
There are also other call to clock_gettime where you can observe an delay. The pattern is identical between the traces.
Then there are some call to mprotect, with some delay, also identical pattern.
btw, this are the error messages I get:
exception: Default TCP listener setup failed, but this is okay because we have a $XDG_RUNTIME_DIR listener: Failed to bind to '[::]:6600'
exception: Failed to bind socket: Address already in use
exception: Unrecognized tag 'Conductor', discarding database file
exception: Input plugin 'tidal' is unavailable: No Tidal application token configured
exception: Input plugin 'qobuz' is unavailable: No Qobuz app_id configured
tidal and qobuz I disabled in the configuration, as well as port settings (I understood there is an service mpd.socket taking care of this,) anyway, it is working.
Remark:
During compilation I got the warning of an outdated libboost 1.67 which is known as buggy.
As far as I tried upgrading libboost will be nightmare on this target, so I would prefer to deal with the outdated version.
br
Arne