Syncthing-Fork v2 uses far too much battery over v1

Hi everyone,

since I upgraded to syncthing v2 through Syncthing-Fork it uses loads of battery. It was getting marginally better with v2.0.10 over v2.0.9 but it still uses over 60 % (2.0.10 fix(syncthing): do not perform CPU benchmark on startup unless logging enabled by @pixelspark in #10398). With v1 syncthing was hardly even noticable compared to other services such as messenger apps e.g. Does someone else also see this behaviour?

I already tried to disable global discovery and relays, which didn’t really help and even with it being on it was working before. My Pixel 6 is on Android 16 and the battery is healthy enough. No changes there except the syncthing update. Also when I am not on wifi or deactivate syncthing my battery is fine again.

When I reported my experiences on syncthing-fork’s Github, the maintainer closed the issue saying that it would be too time consuming to debug and that I shoud try to get help on the forum. He also deleted the issue afterwards. So here we are: I don’t really know what to do now. Can anyone relate? Help would be much appreciated, since I really love syncthing and syncthing-fork.

I also found a related reddit post: https://www.reddit.com/r/Syncthing/comments/1neadwa/syncthing_fork_android_battery_usage/

Greetings!

1 Like

Thank you for reporting. :slightly_smiling_face: I first need to see how many users are affected and make sure we get into the right direction instead of ending up with someone’s wrong ignore patterns causing an ongoing sync of a constantly changed file (just for example). 1:1 is hard for me as I’m busy with real life and we have a lot of Syncthing-Fork users out there since the deprecation of the official Android app. I’ll monitor the thread. Most of the work (regarding sync functionality) is not done by the Android wrapper (which I do).

1 Like

Thanks for your reply!

I should also add, that I already tried a completely new setup from scratch (so no import of an old configuration).

1 Like

I reported the same issue. It was closed with the message Wrapper or native draining? Please check which one., without any guidance on how I can find that out. The issue was also locked so I couldn’t even ask how. I also find the behavior of deleting all issues very sketchy which makes me loose trust in the maintainer.

Either way, @Catfriend1 can you provide guidance on how to find that out, here? Thanks.

That’s not so easy. Sure, you could fork the repo and build the wrapper with no native and dummy run code instead. But I expect it would turn out the battery drain is less or gone then as the resource heavy and functionality work is done by the native. I don’t want to say the wrapper is definitely out, but also don’t recall significant changes in the wrapper code that leads to massive drain compared to v1.x.

I’d be curious to know from the termux users if they experience more drain using v2.x too.

I’ve put a link to this topic on the gh issue.

I run Syncthing inside Termux, but I haven’t really noticed any difference between v1 and v2 in this aspect (and I believe there shouldn’t be any, because v1 and v2 behave the same regarding network connectivity, etc.).

Then it would be interesting to enable verbose logging in the app and see if something obvious heavily repeats in the logs which catches ones eye. The app has two logs: native and wrapper (Android log)

Does using 3 connections instead of 1 by default not count as a network connectivity change?

Yeah, I was thinking more about how devices connect and talk to each other, especially since v1 and v2 are compatible with one another in this aspect. I myself have been using multiple connections for a very long time after enabling them as soon as the option became available in Syncthing v1.

Syncthing-fork v2.0.10 takes 2% battery on my phone which I think is almost identical to v1

Since in my case, I had battery drain, without even configuring sync inside the Android App beyond auto-start and the foreground service notification, it’s easy to reproduce. I disabled the app, installed and started v2.0.10 in termux, and there I have exactly the same problem:

Meaning for me, the drain seems to be caused by syncthing itself, not the wrapper app.

3 Likes

Just to be clear, have you actually checked what happens with Syncthing v1 instead? Syncthing itself will always drain battery, especially when run in Termux with no restrictions, because then it stays running all the time. The main culprit is that it needs to maintain connections to other devices, discovery server, relays, etc., and when doing so, the application prevents the phone from sleeping.

2 Likes

I’m definitely seeing a large increase in battery usage as well. I don’t have stats from pre-v2, but the change has been very noticeable lately. I can provide logs and configs if needed to help troubleshoot this, but some guidance would be nice to know what’s relevant.

1 Like

I would suggest maybe decreasing the connection number to 1 (see https://docs.syncthing.net/advanced/device-numconnections.html and https://docs.syncthing.net/users/tuning.html#tuning-for-low-resources). That’s probably the only major difference when it comes to the default configuration between v1 and v2.

2 Likes

Done.

Just to make sure I did it right: I went to the “Advanced” settings through the WebGUI and under Defaults > Default Device, I set the Num Connections to 1. I also set the Num Connections to 1 for every paired device under Devices. The second part was probably unnecessary.

Actually, the second part was required, and the first one was optional :wink:. This is because the default setting will only apply when you add a new device.

Glad that I asked then. Good to know!

I tried this for every paired device but battery consumption sadly didn’t change much. :frowning:

What phone and android version are you using @sektor2sync? How can it be, that @m11kkaa and I experience such extraordinary battery consumption? @m11kkaa didn’t even need to configure sync to see this behaviour (see his post).

Here is my android.log from yesterday, but I don’t really know, if I should share my syncthing.log, since there might be too much personal information @Catfriend1? I also don’t see many repetitions of anything. Most entries are a couple of minutes or even hours apart.

251006_android.log (559 Bytes)

I used syncthing v1 exclusively before via syncthing for android and later syncthing-fork