ProxioDev / ValioBungee

Synchronize players data between BungeeCord / Velocity proxies
Eclipse Public License 1.0
202 stars 52 forks source link

Storage fill-up fix #111

Open petulikan1 opened 1 month ago

petulikan1 commented 1 month ago

Hey there, I was looking at my redis database and found out that the streams have a flaw that would unnecessarily over-time take storage.

This first image is after a while of starting up the server image

Here this second image is after 10 minutes of starting the server up. This was just 1 single server and without any players image

Now imagine a bigger network with more players... This could eventually by running for 1 whole year on such network take a few GB's of space.

I looked trough the code and figured out where this problem could be addressed and after looking trough the methods, one occured to me that could work. Tried the code and worked as it should - no more messages were appearing and after deleting the stream, it was recreated again by RedisBungee and it stayed at 0 entries resulting in not filling up any more storage.

ham1255 commented 1 month ago

this reason why limit is set to 10000 no need to delete which done by redis automaticlly

petulikan1 commented 1 month ago

Oh is that so? Didn't know that, my bad, sorry for the pull request then.

ham1255 commented 1 month ago

Maybe could make the variable configurable, https://github.com/ProxioDev/ValioBungee/blob/af80e2063b76627c4c150b08c1d77da94f1a5969/api/src/main/java/com/imaginarycode/minecraft/redisbungee/api/ProxyDataManager.java#L42

anyways thanks for pull request