hankhank10 / music-screen-api

Display the playing Sonos track in real time on an e-ink display - also includes functionality for last.fm
120 stars 17 forks source link

Pi Zero performance issue #2

Closed hankhank10 closed 4 years ago

hankhank10 commented 4 years ago

I've found a performance issue with the Pi Zero which occurs at startup.

I think the issue is that PM2 starts both the http-sonos-api and music-screen-api at the same time, but http-sonos-api takes a little while to get set up to actually serve requests due to the Zero being low powered. In the meantime music-screen-api is hitting it with 2 requests a second for data which I think makes it keel over.

I have implemented a choke which makes music-screen-api chill out for 10 seconds when it gets a bad response from http-sonos-api which should hopefully fix it. I would be grateful if anyone running this on a Zero could confirm whether this fixes it.