Yooooomi / your_spotify

Self hosted Spotify tracking dashboard
GNU General Public License v3.0
3.09k stars 124 forks source link

Question - Support for newer mongo DB version? (4.x is EOL) #223

Closed jamess60 closed 1 year ago

jamess60 commented 1 year ago

Hi

I see on the read me "Some ARM-based devices might have trouble with Mongo >= 5. I suggest you use the image mongo:4.4.", assuming I am running this on an x86 platform, is there any reason not to use a newer version?

The Mongo version in the compose example (4.4.8) is almost 3 years old (2021-08), id like to run something newer if possible.

jamess60 commented 1 year ago

Note - it may be worth adding the findings of this to the readme

Yooooomi commented 1 year ago

Hello, I think you can use any newer version as the driver I use is always up to date. I think you can easily try 5.x. Let me know what happens

CrowMash commented 1 year ago

I'm running YourSpotify on mongo:5 and it looks just fine (upgraded on 01/03/23). I tried mongo:6 but I had error and not have the time to look into at the time.

jamess60 commented 1 year ago

Hi both

Sorry for the slow reply, busy week.

I tried going from 4.4.8 (latest 4.x) to 5.0.16 (latest 5.x) on amd64/Linux. Not only did this work fine, but I saw significant improvements in performance when using the last year or all views (I have over a decade of history with average of 90k mins listened per year so its a big db...)

Loading last year went from almost 1 minute to under 10 seconds.

I tried 6.0.5 but the login page gave the red banner saying unable to communicate with server. The your spotify client and your spotify mongo containers both achieved running status, but the your spotify server container got stuck on starting.

I reverted to :5 (the latest 5.x version), same tag @CrowMash is using, zero issues.

While I am not able to easily validate this on ARM hardware, I think it would be wise to update the readme to :5 as this gives a huge performance uplift and is not EOL.

Are there any plans to introduce support for mongo 6?

Yooooomi commented 1 year ago

Hello guys, thanks a lot for the benchmark and the tests. I will definitely look forward to implement mongo 6. If I remember correctly, mongo 4 & 5 were not compatible with arm devices at that time. Maybe better luck with 6 with the arm hype we're currently living.

jamess60 commented 1 year ago

@Yooooomi

I have a couple of M1 Macs (aarch64) and a Pi 4 (also aarch64?). Is there an easy way to test the setup without creating a spotify dev app & logging in etc?

If its as simple as start the 3x containers using my pre-existing compose file, check all 3 containers come up and check that the web page doesnt give the red error banner, id be happy to help test. - Let me know

Yooooomi commented 1 year ago

You have to have the Spotify app and the login process. The nightly image supports mongo 6. To migrate to mongo 6 start the stack using mongo 5, the server will migrate the database. Then stop it and use the mongo 6 image. Be sure to backup your database before doing this. The upgrade has to be incremental, it's a MongoDB restriction.

lorenzopicoli commented 1 year ago

I'm running mongo 6 with no problems after upgrading like @Yooooomi described

ikaruswill commented 1 year ago

Hi folks, just wanted to chyme in that MongoDB 5.0+ requires AVX Instruction set extension.

WARNING: MongoDB 5.0+ requires a CPU with AVX support, and your current system does not appear to have that!
  see https://jira.mongodb.org/browse/SERVER-54407
  see also https://www.mongodb.com/community/forums/t/mongodb-5-0-cpu-intel-g4650-compatibility/116610/2
  see also https://github.com/docker-library/mongo/issues/485#issuecomment-891991814

I'm running your_spotify on low-power CPUs (J5005 and N5105) and AVX is not supported.

Only the latest Alder Lake N series processors support it (N100).

Thought I'd raise it up here for awareness for all others who are running low-power x86 in their homelabs. For now I'm sticking to MongoDB 4.4.x

Yooooomi commented 1 year ago

Thanks, i added a note in the release notes

jamess60 commented 1 year ago

Hi all

Sorry for the slow update.

@ikaruswill Very good find. Im running mine on E5-2697V2s so doubt this is a blocker in my case, but could certainly see that being problematic for some.

I am still running the :latest tags of the client and server, given they were last committed to git 2 months ago, I assume they are indeed latest despite not re-pulling for a few days.

Looking at my reply on Apr 15th, I went from 4 latest to 5 latest to any version of 6 and it didn't work, but going back to 5 was fine. It looks like I accidentally did the process outlined by @Yooooomi - I guess this is therefore still something that only works on nightly? If so, any idea when this will make it to stable?

Yooooomi commented 1 year ago

Hello. This should be stable by now. Could you try repulling?

jamess60 commented 1 year ago

Hi @Yooooomi

I updated the image and tested again. I was already on mongo 5, so I stepped to 6.0 -> 6.0.6 -> latest and it appears to work fine! Thanks for fixing this :) - Will close the issue

TLDR of the thread for newcomers: